summaryrefslogtreecommitdiff
path: root/lib/chef_zero/rspec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef_zero/rspec.rb')
-rw-r--r--lib/chef_zero/rspec.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/chef_zero/rspec.rb b/lib/chef_zero/rspec.rb
index 18155e8..b41a944 100644
--- a/lib/chef_zero/rspec.rb
+++ b/lib/chef_zero/rspec.rb
@@ -46,23 +46,25 @@ module ChefZero
extend WhenTheChefServerClassMethods
include WhenTheChefServerInstanceMethods
+ @@chef_server_options = { port: 8900, signals: false, log_requests: true, server_scope: :each }
+
def self.chef_server_options
@@chef_server_options
end
+
def chef_server_options
self.class.chef_server_options
end
- @@chef_server_options = { port: 8900, signals: false, log_requests: true, server_scope: :each }
- chef_server_options = self.chef_server_options
- chef_server_options = chef_server_options.merge(chef_zero_opts) if self.respond_to?(:chef_zero_opts)
- chef_server_options = chef_server_options.merge(tags.last) if tags.last.is_a?(Hash)
-
old_chef_server_url = nil
old_node_name = nil
old_client_key = nil
before chef_server_options[:server_scope] do
+ chef_server_options = self.chef_server_options
+ chef_server_options = chef_server_options.merge(chef_zero_opts) if self.respond_to?(:chef_zero_opts)
+ chef_server_options = chef_server_options.merge(tags.last) if tags.last.is_a?(Hash)
+
Log.debug("Starting Chef server with options #{chef_server_options}")
ChefZero::RSpec.set_server_options(chef_server_options)