diff options
author | John Keiser <jkeiser@opscode.com> | 2014-06-02 14:56:35 -0700 |
---|---|---|
committer | John Keiser <jkeiser@opscode.com> | 2014-06-02 14:56:35 -0700 |
commit | a1d5a5d147afad5aa41c99e1b00ce0f543c33dae (patch) | |
tree | 0915a339b81e83b9bbf426ec2f8f71caacec021f /spec | |
parent | 9a1500be6d98828454a740c77403f1b3e74e28ed (diff) | |
download | chef-zero-a1d5a5d147afad5aa41c99e1b00ce0f543c33dae.tar.gz |
Honor :single_org => 'orgname' parameter everywhere
Diffstat (limited to 'spec')
-rw-r--r-- | spec/run.rb | 11 | ||||
-rw-r--r-- | spec/support/pedant.rb | 6 |
2 files changed, 13 insertions, 4 deletions
diff --git a/spec/run.rb b/spec/run.rb index aec8176..11084ea 100644 --- a/spec/run.rb +++ b/spec/run.rb @@ -7,7 +7,7 @@ require 'rspec/core' tmpdir = nil -def start_server(chef_repo_path) +def start_local_server(chef_repo_path) Dir.mkdir(chef_repo_path) if !File.exists?(chef_repo_path) # 11.6 and below had a bug where it couldn't create the repo children automatically @@ -43,10 +43,15 @@ begin chef_repo_path = "#{tmpdir}/repo" # Capture setup data into master_chef_repo_path - server = start_server(chef_repo_path) + server = start_local_server(chef_repo_path) + + elsif ENV['SINGLE_ORG'] + server = ChefZero::Server.new(:port => 8889, :single_org => 'singleorg') + server.start_background else - server = ChefZero::Server.new(:port => 8889) + server = ChefZero::Server.new(:port => 8889, :single_org => false) + server.data_store.create_dir([ 'organizations' ], 'pedant') server.start_background end diff --git a/spec/support/pedant.rb b/spec/support/pedant.rb index d21a2f7..3ac1922 100644 --- a/spec/support/pedant.rb +++ b/spec/support/pedant.rb @@ -21,7 +21,11 @@ ################################################################################ # You MUST specify the address of the server the API requests will be # sent to. Only specify protocol, hostname, and port. -chef_server 'http://127.0.0.1:8889' +if ENV['SINGLE_ORG'] + chef_server 'http://127.0.0.1:8889' +else + chef_server 'http://127.0.0.1:8889/organizations/pedant' +end # If you are doing development testing, you can specify the address of # the Solr server. The presence of this parameter will enable tests |