Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add scenario for Chef::Config['solo'], refs #26.

  • Loading branch information...
commit bf51e99722270dc655a31c63daa96f3433c586cf 1 parent a88d402
@acrmp authored
View
5 features/003_check_for_chef_server.feature
@@ -25,3 +25,8 @@ Feature: Check for Chef Server
Given a cookbook with a single recipe that searches but checks first to see if this is server
When I check the cookbook
Then the check for server warning 003 should not be displayed given we have checked
+
+ Scenario: Search checking for server (string access)
+ Given a cookbook with a single recipe that searches but checks first (string) to see if this is server
+ When I check the cookbook
+ Then the check for server warning 003 should not be displayed given we have checked
View
8 features/step_definitions/cookbook_steps.rb
@@ -636,12 +636,12 @@ def in_tier?(*tier)
'a literal and interpolated variable' => :literal_and_interpolated_symbol}[path_type])
end
-Given 'a cookbook with a single recipe that searches but checks first to see if this is server' do
- write_recipe %q{
- if Chef::Config[:solo]
+Given /^a cookbook with a single recipe that searches but checks first( \(string\))? to see if this is server$/ do |str|
+ write_recipe %Q{
+ if Chef::Config[#{str ? "'solo'" : ":solo"}]
Chef::Log.warn("This recipe uses search. Chef Solo does not support search.")
else
- nodes = search(:node, "hostname:[* TO *] AND chef_environment:#{node.chef_environment}")
+ nodes = search(:node, "hostname:[* TO *] AND chef_environment:#\{node.chef_environment\}")
end
}
end
Please sign in to comment.
Something went wrong with that request. Please try again.