summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authordanielsdeleo <dan@getchef.com>2015-05-18 14:10:45 -0700
committerdanielsdeleo <dan@getchef.com>2015-05-18 14:10:45 -0700
commitfa54063458263fa2d53ea2ab6aef8ad7c2a50e51 (patch)
treebc121331e7825af8d8619a166704d96dbd8dd69e /lib
parent0ca756f189037796180db32c597f188d80410fb7 (diff)
downloadchef-zero-fa54063458263fa2d53ea2ab6aef8ad7c2a50e51.tar.gz
Access server opts in example context not describe context
Diffstat (limited to 'lib')
-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)