summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJohn Keiser <jkeiser@opscode.com>2014-07-16 22:37:08 -0700
committerJohn Keiser <jkeiser@opscode.com>2014-07-23 19:21:24 -0600
commit08b2e660be71fb6a90a6638729f010429b8c3e98 (patch)
treef0eaa4b2eca7618668ecfd327c0d8c38941d0c8c /spec
parentf8658b80828262b5356f086f6c6ea69b706dde06 (diff)
downloadchef-zero-08b2e660be71fb6a90a6638729f010429b8c3e98.tar.gz
Add file store
Diffstat (limited to 'spec')
-rw-r--r--spec/run.rb9
-rw-r--r--spec/support/pedant.rb2
2 files changed, 10 insertions, 1 deletions
diff --git a/spec/run.rb b/spec/run.rb
index a0aaf40..bddf434 100644
--- a/spec/run.rb
+++ b/spec/run.rb
@@ -49,6 +49,15 @@ begin
server = ChefZero::Server.new(:port => 8889, :single_org => 'chef')
server.start_background
+ elsif ENV['FILE_STORE']
+ require 'tmpdir'
+ require 'chef_zero/data_store/raw_file_store'
+ tmpdir = Dir.mktmpdir
+ data_store = ChefZero::DataStore::RawFileStore.new(tmpdir, true)
+ data_store = ChefZero::DataStore::DefaultFacade.new(data_store, true)
+ server = ChefZero::Server.new(:port => 8889, :single_org => 'chef', :data_store => data_store)
+ server.start_background
+
else
server = ChefZero::Server.new(:port => 8889, :single_org => false, :osc_compat => true)
server.data_store.create_dir([ 'organizations' ], 'pedant')
diff --git a/spec/support/pedant.rb b/spec/support/pedant.rb
index 3ac1922..d6100d2 100644
--- a/spec/support/pedant.rb
+++ b/spec/support/pedant.rb
@@ -21,7 +21,7 @@
################################################################################
# You MUST specify the address of the server the API requests will be
# sent to. Only specify protocol, hostname, and port.
-if ENV['SINGLE_ORG']
+if ENV['SINGLE_ORG'] || ENV['FILE_STORE']
chef_server 'http://127.0.0.1:8889'
else
chef_server 'http://127.0.0.1:8889/organizations/pedant'