summaryrefslogtreecommitdiff
path: root/spec/unit/dsl
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-08-17 12:15:26 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2016-08-17 13:25:02 -0700
commita0c32511bc6634538374ca4b433032b8acd05f96 (patch)
tree15c7cfbd0d773488ab814e7c24f0c58505c9134b /spec/unit/dsl
parent3d0379a2ad531a0b3db5ed2827bf30ef07b26100 (diff)
downloadchef-a0c32511bc6634538374ca4b433032b8acd05f96.tar.gz
fix Style/BlockDelimiters, Style/MultilineBlockLayout and 0.42.0 engine upgrade
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/unit/dsl')
-rw-r--r--spec/unit/dsl/audit_spec.rb6
-rw-r--r--spec/unit/dsl/data_query_spec.rb5
-rw-r--r--spec/unit/dsl/declare_resource_spec.rb20
3 files changed, 16 insertions, 15 deletions
diff --git a/spec/unit/dsl/audit_spec.rb b/spec/unit/dsl/audit_spec.rb
index a8227f6c99..42e543fdb2 100644
--- a/spec/unit/dsl/audit_spec.rb
+++ b/spec/unit/dsl/audit_spec.rb
@@ -21,14 +21,14 @@ describe Chef::DSL::Audit do
end
it "raises an error when no audit name is given" do
- expect { auditor.control_group do end }.to raise_error(Chef::Exceptions::AuditNameMissing)
+ expect { auditor.control_group {} }.to raise_error(Chef::Exceptions::AuditNameMissing)
end
context "audits already populated" do
let(:audits) { { "unique" => {} } }
it "raises an error if the audit name is a duplicate" do
- expect { auditor.control_group "unique" do end }.to raise_error(Chef::Exceptions::AuditControlGroupDuplicate)
+ expect { auditor.control_group("unique") {} }.to raise_error(Chef::Exceptions::AuditControlGroupDuplicate)
end
end
@@ -36,7 +36,7 @@ describe Chef::DSL::Audit do
let(:auditor) { BadAuditDSLTester.new }
it "fails because it relies on the recipe DSL existing" do
- expect { auditor.control_group "unique" do end }.to raise_error(NoMethodError, /undefined method `cookbook_name'/)
+ expect { auditor.control_group("unique") {} }.to raise_error(NoMethodError, /undefined method `cookbook_name'/)
end
end
diff --git a/spec/unit/dsl/data_query_spec.rb b/spec/unit/dsl/data_query_spec.rb
index 55c6e5f578..f93f07bc52 100644
--- a/spec/unit/dsl/data_query_spec.rb
+++ b/spec/unit/dsl/data_query_spec.rb
@@ -60,14 +60,15 @@ describe Chef::DSL::DataQuery do
let(:item_name) { "item_name" }
- let(:raw_data) {{
+ let(:raw_data) do
+ {
"id" => item_name,
"greeting" => "hello",
"nested" => {
"a1" => [1, 2, 3],
"a2" => { "b1" => true },
},
- }}
+ } end
let(:item) do
item = Chef::DataBagItem.new
diff --git a/spec/unit/dsl/declare_resource_spec.rb b/spec/unit/dsl/declare_resource_spec.rb
index 692e57d2e1..57a7fd7f18 100644
--- a/spec/unit/dsl/declare_resource_spec.rb
+++ b/spec/unit/dsl/declare_resource_spec.rb
@@ -50,17 +50,17 @@ describe Chef::ResourceCollection do
describe "#edit_resource!" do
it "raises if nothing is found" do
- expect {
+ expect do
recipe.edit_resource!(:zen_master, "monkey") do
something true
end
- }.to raise_error(Chef::Exceptions::ResourceNotFound)
+ end.to raise_error(Chef::Exceptions::ResourceNotFound)
end
it "raises if nothing is found and no block is given" do
- expect {
+ expect do
recipe.edit_resource!(:zen_master, "monkey")
- }.to raise_error(Chef::Exceptions::ResourceNotFound)
+ end.to raise_error(Chef::Exceptions::ResourceNotFound)
end
it "edits the resource if it finds one" do
@@ -131,20 +131,20 @@ describe Chef::ResourceCollection do
describe "#find_resource!" do
it "raises if nothing is found" do
- expect {
+ expect do
recipe.find_resource!(:zen_master, "monkey")
- }.to raise_error(Chef::Exceptions::ResourceNotFound)
+ end.to raise_error(Chef::Exceptions::ResourceNotFound)
end
it "raises if given a block" do
resource = recipe.declare_resource(:zen_master, "monkey") do
something false
end
- expect {
+ expect do
recipe.find_resource!(:zen_master, "monkey") do
something false
end
- }.to raise_error(ArgumentError)
+ end.to raise_error(ArgumentError)
end
it "returns the resource if it finds one" do
@@ -221,9 +221,9 @@ describe Chef::ResourceCollection do
describe "#delete_resource!" do
it "raises if nothing is found" do
- expect {
+ expect do
recipe.delete_resource!(:zen_master, "monkey")
- }.to raise_error(Chef::Exceptions::ResourceNotFound)
+ end.to raise_error(Chef::Exceptions::ResourceNotFound)
end
it "deletes and returns the resource if it finds one" do