summaryrefslogtreecommitdiff
path: root/spec/unit/recipe_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/recipe_spec.rb')
-rw-r--r--spec/unit/recipe_spec.rb26
1 files changed, 13 insertions, 13 deletions
diff --git a/spec/unit/recipe_spec.rb b/spec/unit/recipe_spec.rb
index 93d03756a7..3b16edaa4a 100644
--- a/spec/unit/recipe_spec.rb
+++ b/spec/unit/recipe_spec.rb
@@ -110,7 +110,7 @@ describe Chef::Recipe do
it "locate resource for particular platform" do
ShaunTheSheep = Class.new(Chef::Resource)
ShaunTheSheep.resource_name :shaun_the_sheep
- ShaunTheSheep.provides :laughter, :platform => ["television"]
+ ShaunTheSheep.provides :laughter, platform: ["television"]
node.automatic[:platform] = "television"
node.automatic[:platform_version] = "123"
res = recipe.laughter "timmy"
@@ -183,7 +183,7 @@ describe Chef::Recipe do
it "does not add the resource to the resource collection" do
zm_resource # force let binding evaluation
- expect { run_context.resource_collection.resources(:zen_master => "klopp") }.to raise_error(Chef::Exceptions::ResourceNotFound)
+ expect { run_context.resource_collection.resources(zen_master: "klopp") }.to raise_error(Chef::Exceptions::ResourceNotFound)
end
end
@@ -238,7 +238,7 @@ describe Chef::Recipe do
it "adds the resource to the resource collection" do
zm_resource # force let binding evaluation
- expect(run_context.resource_collection.resources(:zen_master => "klopp")).to eq(zm_resource)
+ expect(run_context.resource_collection.resources(zen_master: "klopp")).to eq(zm_resource)
end
it "will insert another resource if create_if_missing is not set (cloned resource as of Chef-12)" do
@@ -339,7 +339,7 @@ describe Chef::Recipe do
describe "resource definitions" do
it "should execute defined resources" do
crow_define = Chef::ResourceDefinition.new
- crow_define.define :crow, :peace => false, :something => true do
+ crow_define.define :crow, peace: false, something: true do
zen_master "lao tzu" do
peace params[:peace]
something params[:something]
@@ -349,13 +349,13 @@ describe Chef::Recipe do
recipe.crow "mine" do
peace true
end
- expect(run_context.resource_collection.resources(:zen_master => "lao tzu").name).to eql("lao tzu")
- expect(run_context.resource_collection.resources(:zen_master => "lao tzu").something).to eql(true)
+ expect(run_context.resource_collection.resources(zen_master: "lao tzu").name).to eql("lao tzu")
+ expect(run_context.resource_collection.resources(zen_master: "lao tzu").something).to eql(true)
end
it "should set the node on defined resources" do
crow_define = Chef::ResourceDefinition.new
- crow_define.define :crow, :peace => false, :something => true do
+ crow_define.define :crow, peace: false, something: true do
zen_master "lao tzu" do
peace params[:peace]
something params[:something]
@@ -366,12 +366,12 @@ describe Chef::Recipe do
recipe.crow "mine" do
something node[:foo]
end
- expect(recipe.resources(:zen_master => "lao tzu").something).to eql(false)
+ expect(recipe.resources(zen_master: "lao tzu").something).to eql(false)
end
it "should return the last statement in the definition as the retval" do
crow_define = Chef::ResourceDefinition.new
- crow_define.define :crow, :peace => false, :something => true do
+ crow_define.define :crow, peace: false, something: true do
"the return val"
end
run_context.definitions[:crow] = crow_define
@@ -392,7 +392,7 @@ describe Chef::Recipe do
end
CODE
expect { recipe.instance_eval(code) }.not_to raise_error
- expect(recipe.resources(:zen_master => "gnome").name).to eql("gnome")
+ expect(recipe.resources(zen_master: "gnome").name).to eql("gnome")
end
end
@@ -408,7 +408,7 @@ describe Chef::Recipe do
describe "from_file" do
it "should load a resource from a ruby file" do
recipe.from_file(File.join(CHEF_SPEC_DATA, "recipes", "test.rb"))
- res = recipe.resources(:file => "/etc/nsswitch.conf")
+ res = recipe.resources(file: "/etc/nsswitch.conf")
expect(res.name).to eql("/etc/nsswitch.conf")
expect(res.action).to eql([:create])
expect(res.owner).to eql("root")
@@ -426,7 +426,7 @@ describe Chef::Recipe do
expect(node).to receive(:loaded_recipe).with(:openldap, "gigantor")
allow(run_context).to receive(:unreachable_cookbook?).with(:openldap).and_return(false)
run_context.include_recipe "openldap::gigantor"
- res = run_context.resource_collection.resources(:cat => "blanket")
+ res = run_context.resource_collection.resources(cat: "blanket")
expect(res.name).to eql("blanket")
expect(res.pretty_kitty).to eql(false)
end
@@ -435,7 +435,7 @@ describe Chef::Recipe do
expect(node).to receive(:loaded_recipe).with(:openldap, "default")
allow(run_context).to receive(:unreachable_cookbook?).with(:openldap).and_return(false)
run_context.include_recipe "openldap"
- res = run_context.resource_collection.resources(:cat => "blanket")
+ res = run_context.resource_collection.resources(cat: "blanket")
expect(res.name).to eql("blanket")
expect(res.pretty_kitty).to eql(true)
end