summaryrefslogtreecommitdiff
path: root/spec/integration/recipes
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2016-01-14 14:08:03 +0000
committerThom May <thom@chef.io>2016-01-14 14:08:03 +0000
commit51cfbdc4d16739caac4d946fadbe678444aafe34 (patch)
tree56dfd8f1cd9fd933de27268b32402e955a43ac2b /spec/integration/recipes
parent05064423057d4cf46f4713b81b08829cf6d20af6 (diff)
downloadchef-51cfbdc4d16739caac4d946fadbe678444aafe34.tar.gz
Use double quotes by default
This is an entirely mechanically generated (chefstyle -a) change, to go along with chef/chefstyle#5 . We should pick something and use it consistently, and my opinion is that double quotes are the appropriate thing.
Diffstat (limited to 'spec/integration/recipes')
-rw-r--r--spec/integration/recipes/lwrp_inline_resources_spec.rb36
-rw-r--r--spec/integration/recipes/lwrp_spec.rb14
-rw-r--r--spec/integration/recipes/provider_choice.rb4
-rw-r--r--spec/integration/recipes/recipe_dsl_spec.rb244
-rw-r--r--spec/integration/recipes/remote_directory.rb4
-rw-r--r--spec/integration/recipes/resource_action_spec.rb100
-rw-r--r--spec/integration/recipes/resource_converge_if_changed_spec.rb22
-rw-r--r--spec/integration/recipes/resource_load_spec.rb48
8 files changed, 236 insertions, 236 deletions
diff --git a/spec/integration/recipes/lwrp_inline_resources_spec.rb b/spec/integration/recipes/lwrp_inline_resources_spec.rb
index bd5eaf66a4..dc7e19a3cb 100644
--- a/spec/integration/recipes/lwrp_inline_resources_spec.rb
+++ b/spec/integration/recipes/lwrp_inline_resources_spec.rb
@@ -1,5 +1,5 @@
-require 'support/shared/integration/integration_helper'
-require 'chef/mixin/shell_out'
+require "support/shared/integration/integration_helper"
+require "chef/mixin/shell_out"
describe "LWRPs with inline resources" do
include IntegrationSupport
@@ -29,7 +29,7 @@ describe "LWRPs with inline resources" do
use_inline_resources
def action_a
r = new_resource
- ruby_block 'run a' do
+ ruby_block "run a" do
block { r.ran_a "ran a" }
end
end
@@ -39,8 +39,8 @@ describe "LWRPs with inline resources" do
it "this is totally a bug, but for backcompat purposes, it adds the resources to the main resource collection and does not get marked updated" do
r = nil
expect_recipe {
- r = lwrp_inline_resources_test 'hi'
- }.to have_updated('ruby_block[run a]', :run)
+ r = lwrp_inline_resources_test "hi"
+ }.to have_updated("ruby_block[run a]", :run)
expect(r.ran_a).to eq "ran a"
end
end
@@ -58,7 +58,7 @@ describe "LWRPs with inline resources" do
action :a do
r = new_resource
- ruby_block 'run a' do
+ ruby_block "run a" do
block { r.ran_a "ran a" }
end
end
@@ -68,7 +68,7 @@ describe "LWRPs with inline resources" do
r = new_resource
# Grab ran_a right now, before we converge
ran_a = r.ran_a
- ruby_block 'run b' do
+ ruby_block "run b" do
block { r.ran_b "ran b: ran_a value was #{ran_a.inspect}" }
end
end
@@ -78,34 +78,34 @@ describe "LWRPs with inline resources" do
it "resources declared in b are executed immediately inline" do
r = nil
expect_recipe {
- r = lwrp_inline_resources_test2 'hi' do
+ r = lwrp_inline_resources_test2 "hi" do
action :b
end
- }.to have_updated('lwrp_inline_resources_test2[hi]', :b).
- and have_updated('ruby_block[run a]', :run).
- and have_updated('ruby_block[run b]', :run)
+ }.to have_updated("lwrp_inline_resources_test2[hi]", :b).
+ and have_updated("ruby_block[run a]", :run).
+ and have_updated("ruby_block[run b]", :run)
expect(r.ran_b).to eq "ran b: ran_a value was \"ran a\""
end
end
when_the_repository "has a cookbook with a nested LWRP" do
before do
- directory 'cookbooks/x' do
+ directory "cookbooks/x" do
- file 'resources/do_nothing.rb', <<-EOM
+ file "resources/do_nothing.rb", <<-EOM
actions :create, :nothing
default_action :create
EOM
- file 'providers/do_nothing.rb', <<-EOM
+ file "providers/do_nothing.rb", <<-EOM
action :create do
end
EOM
- file 'resources/my_machine.rb', <<-EOM
+ file "resources/my_machine.rb", <<-EOM
actions :create, :nothing
default_action :create
EOM
- file 'providers/my_machine.rb', <<-EOM
+ file "providers/my_machine.rb", <<-EOM
use_inline_resources
action :create do
x_do_nothing 'a'
@@ -113,7 +113,7 @@ describe "LWRPs with inline resources" do
end
EOM
- file 'recipes/default.rb', <<-EOM
+ file "recipes/default.rb", <<-EOM
x_my_machine "me"
x_my_machine "you"
EOM
@@ -122,7 +122,7 @@ describe "LWRPs with inline resources" do
end
it "should complete with success" do
- file 'config/client.rb', <<EOM
+ file "config/client.rb", <<EOM
local_mode true
cookbook_path "#{path_to('cookbooks')}"
log_level :warn
diff --git a/spec/integration/recipes/lwrp_spec.rb b/spec/integration/recipes/lwrp_spec.rb
index 7ecdfc7c3a..3bc008d4f8 100644
--- a/spec/integration/recipes/lwrp_spec.rb
+++ b/spec/integration/recipes/lwrp_spec.rb
@@ -1,5 +1,5 @@
-require 'support/shared/integration/integration_helper'
-require 'chef/mixin/shell_out'
+require "support/shared/integration/integration_helper"
+require "chef/mixin/shell_out"
describe "LWRPs" do
include IntegrationSupport
@@ -20,17 +20,17 @@ describe "LWRPs" do
when_the_repository "has a cookbook named l-w-r-p" do
before do
- directory 'cookbooks/l-w-r-p' do
+ directory "cookbooks/l-w-r-p" do
- file 'resources/foo.rb', <<EOM
+ file "resources/foo.rb", <<EOM
default_action :create
EOM
- file 'providers/foo.rb', <<EOM
+ file "providers/foo.rb", <<EOM
action :create do
end
EOM
- file 'recipes/default.rb', <<EOM
+ file "recipes/default.rb", <<EOM
l_w_r_p_foo "me"
EOM
@@ -38,7 +38,7 @@ EOM
end
it "should complete with success" do
- file 'config/client.rb', <<EOM
+ file "config/client.rb", <<EOM
local_mode true
cookbook_path "#{path_to('cookbooks')}"
log_level :warn
diff --git a/spec/integration/recipes/provider_choice.rb b/spec/integration/recipes/provider_choice.rb
index 01537b2c05..d08090bbe8 100644
--- a/spec/integration/recipes/provider_choice.rb
+++ b/spec/integration/recipes/provider_choice.rb
@@ -1,4 +1,4 @@
-require 'support/shared/integration/integration_helper'
+require "support/shared/integration/integration_helper"
describe "Recipe DSL methods" do
include IntegrationSupport
@@ -26,7 +26,7 @@ describe "Recipe DSL methods" do
it "provider_thingy 'blah' runs the provider and warns" do
recipe = converge {
- provider_thingy 'blah' do; end
+ provider_thingy "blah" do; end
}
expect(recipe.logged_warnings).to match /hello from Chef::Provider::ProviderThingy/
expect(recipe.logged_warnings).to match /you must use 'provides' to provide DSL/i
diff --git a/spec/integration/recipes/recipe_dsl_spec.rb b/spec/integration/recipes/recipe_dsl_spec.rb
index 52bca87c99..db4d158eec 100644
--- a/spec/integration/recipes/recipe_dsl_spec.rb
+++ b/spec/integration/recipes/recipe_dsl_spec.rb
@@ -1,4 +1,4 @@
-require 'support/shared/integration/integration_helper'
+require "support/shared/integration/integration_helper"
describe "Recipe DSL methods" do
include IntegrationSupport
@@ -15,7 +15,7 @@ describe "Recipe DSL methods" do
before(:context) {
class BaseThingy < Chef::Resource
- resource_name 'base_thingy'
+ resource_name "base_thingy"
default_action :create
class<<self
@@ -51,27 +51,27 @@ describe "Recipe DSL methods" do
it "creates base_thingy when you call base_thingy in a recipe" do
recipe = converge {
- base_thingy 'blah' do; end
+ base_thingy "blah" do; end
}
- expect(recipe.logged_warnings).to eq ''
- expect(BaseThingy.created_name).to eq 'blah'
+ expect(recipe.logged_warnings).to eq ""
+ expect(BaseThingy.created_name).to eq "blah"
expect(BaseThingy.created_resource).to eq BaseThingy
end
it "errors out when you call base_thingy do ... end in a recipe" do
expect_converge {
base_thingy do; end
- }.to raise_error(ArgumentError, 'You must supply a name when declaring a base_thingy resource')
+ }.to raise_error(ArgumentError, "You must supply a name when declaring a base_thingy resource")
end
it "emits a warning when you call base_thingy 'foo', 'bar' do ... end in a recipe" do
Chef::Config[:treat_deprecation_warnings_as_errors] = false
recipe = converge {
- base_thingy 'foo', 'bar' do
+ base_thingy "foo", "bar" do
end
}
expect(recipe.logged_warnings).to match(/Cannot create resource base_thingy with more than one argument. All arguments except the name \("foo"\) will be ignored. This will cause an error in Chef 13. Arguments: \["foo", "bar"\]/)
- expect(BaseThingy.created_name).to eq 'foo'
+ expect(BaseThingy.created_name).to eq "foo"
expect(BaseThingy.created_resource).to eq BaseThingy
end
@@ -99,7 +99,7 @@ describe "Recipe DSL methods" do
it "backcompat_thingy creates a Chef::Resource::BackcompatThingy" do
recipe = converge {
- backcompat_thingy 'blah' do; end
+ backcompat_thingy "blah" do; end
}
expect(BaseThingy.created_resource).to eq Chef::Resource::BackcompatThingy
expect(BaseThingy.created_provider).to eq Chef::Provider::BackcompatThingy
@@ -117,7 +117,7 @@ describe "Recipe DSL methods" do
it "backcompat_thingy creates a BackcompatThingy" do
recipe = converge {
- backcompat_thingy 'blah' do; end
+ backcompat_thingy "blah" do; end
}
expect(recipe.logged_warnings).to match(/Class Chef::Provider::BackcompatThingy does not declare 'provides :backcompat_thingy'./)
expect(BaseThingy.created_resource).not_to be_nil
@@ -135,7 +135,7 @@ describe "Recipe DSL methods" do
it "bar_thingy does not work" do
expect_converge {
- bar_thingy 'blah' do; end
+ bar_thingy "blah" do; end
}.to raise_error(NoMethodError)
end
end
@@ -151,7 +151,7 @@ describe "Recipe DSL methods" do
it "no_name_thingy does not work" do
expect_converge {
- no_name_thingy 'blah' do; end
+ no_name_thingy "blah" do; end
}.to raise_error(NoMethodError)
end
end
@@ -167,15 +167,15 @@ describe "Recipe DSL methods" do
it "another_no_name_thingy does not work" do
expect_converge {
- another_no_name_thingy 'blah' do; end
+ another_no_name_thingy "blah" do; end
}.to raise_error(NoMethodError)
end
it "another_thingy_name works" do
recipe = converge {
- another_thingy_name 'blah' do; end
+ another_thingy_name "blah" do; end
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_resource).to eq(AnotherNoNameThingy)
end
end
@@ -192,21 +192,21 @@ describe "Recipe DSL methods" do
it "another_no_name_thingy does not work" do
expect_converge {
- another_no_name_thingy2 'blah' do; end
+ another_no_name_thingy2 "blah" do; end
}.to raise_error(NoMethodError)
end
it "another_thingy_name2 does not work" do
expect_converge {
- another_thingy_name2 'blah' do; end
+ another_thingy_name2 "blah" do; end
}.to raise_error(NoMethodError)
end
it "yet_another_thingy_name3 works" do
recipe = converge {
- another_thingy_name3 'blah' do; end
+ another_thingy_name3 "blah" do; end
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_resource).to eq(AnotherNoNameThingy2)
end
end
@@ -217,7 +217,7 @@ describe "Recipe DSL methods" do
class AnotherNoNameThingy3 < BaseThingy
resource_name :another_no_name_thingy_3
- provides :another_no_name_thingy3, os: 'blarghle'
+ provides :another_no_name_thingy3, os: "blarghle"
end
}
@@ -225,18 +225,18 @@ describe "Recipe DSL methods" do
it "and os = linux, another_no_name_thingy3 does not work" do
expect_converge {
# TODO this is an ugly way to test, make Cheffish expose node attrs
- run_context.node.automatic[:os] = 'linux'
- another_no_name_thingy3 'blah' do; end
+ run_context.node.automatic[:os] = "linux"
+ another_no_name_thingy3 "blah" do; end
}.to raise_error(Chef::Exceptions::NoSuchResourceType)
end
it "and os = blarghle, another_no_name_thingy3 works" do
recipe = converge {
# TODO this is an ugly way to test, make Cheffish expose node attrs
- run_context.node.automatic[:os] = 'blarghle'
- another_no_name_thingy3 'blah' do; end
+ run_context.node.automatic[:os] = "blarghle"
+ another_no_name_thingy3 "blah" do; end
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_resource).to eq (AnotherNoNameThingy3)
end
end
@@ -246,8 +246,8 @@ describe "Recipe DSL methods" do
class AnotherNoNameThingy4 < BaseThingy
resource_name :another_no_name_thingy_4
- provides :another_no_name_thingy4, os: 'blarghle'
- provides :another_no_name_thingy4, platform_family: 'foo'
+ provides :another_no_name_thingy4, os: "blarghle"
+ provides :another_no_name_thingy4, platform_family: "foo"
end
}
@@ -255,28 +255,28 @@ describe "Recipe DSL methods" do
it "and os = linux, another_no_name_thingy4 does not work" do
expect_converge {
# TODO this is an ugly way to test, make Cheffish expose node attrs
- run_context.node.automatic[:os] = 'linux'
- another_no_name_thingy4 'blah' do; end
+ run_context.node.automatic[:os] = "linux"
+ another_no_name_thingy4 "blah" do; end
}.to raise_error(Chef::Exceptions::NoSuchResourceType)
end
it "and os = blarghle, another_no_name_thingy4 works" do
recipe = converge {
# TODO this is an ugly way to test, make Cheffish expose node attrs
- run_context.node.automatic[:os] = 'blarghle'
- another_no_name_thingy4 'blah' do; end
+ run_context.node.automatic[:os] = "blarghle"
+ another_no_name_thingy4 "blah" do; end
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_resource).to eq (AnotherNoNameThingy4)
end
it "and platform_family = foo, another_no_name_thingy4 works" do
recipe = converge {
# TODO this is an ugly way to test, make Cheffish expose node attrs
- run_context.node.automatic[:platform_family] = 'foo'
- another_no_name_thingy4 'blah' do; end
+ run_context.node.automatic[:platform_family] = "foo"
+ another_no_name_thingy4 "blah" do; end
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_resource).to eq (AnotherNoNameThingy4)
end
end
@@ -286,7 +286,7 @@ describe "Recipe DSL methods" do
class AnotherNoNameThingy5 < BaseThingy
resource_name :another_thingy_name_for_another_no_name_thingy5
- provides :another_no_name_thingy5, os: 'blarghle'
+ provides :another_no_name_thingy5, os: "blarghle"
end
}
@@ -294,26 +294,26 @@ describe "Recipe DSL methods" do
it "and os = linux, another_no_name_thingy5 does not work" do
expect_converge {
# this is an ugly way to test, make Cheffish expose node attrs
- run_context.node.automatic[:os] = 'linux'
- another_no_name_thingy5 'blah' do; end
+ run_context.node.automatic[:os] = "linux"
+ another_no_name_thingy5 "blah" do; end
}.to raise_error(Chef::Exceptions::NoSuchResourceType)
end
it "and os = blarghle, another_no_name_thingy5 works" do
recipe = converge {
# this is an ugly way to test, make Cheffish expose node attrs
- run_context.node.automatic[:os] = 'blarghle'
- another_no_name_thingy5 'blah' do; end
+ run_context.node.automatic[:os] = "blarghle"
+ another_no_name_thingy5 "blah" do; end
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_resource).to eq (AnotherNoNameThingy5)
end
it "the new resource name can be used in a recipe" do
recipe = converge {
- another_thingy_name_for_another_no_name_thingy5 'blah' do; end
+ another_thingy_name_for_another_no_name_thingy5 "blah" do; end
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_resource).to eq (AnotherNoNameThingy5)
end
end
@@ -322,7 +322,7 @@ describe "Recipe DSL methods" do
before(:context) {
class AnotherNoNameThingy6 < BaseThingy
- provides :another_no_name_thingy6, os: 'blarghle'
+ provides :another_no_name_thingy6, os: "blarghle"
resource_name :another_thingy_name_for_another_no_name_thingy6
end
@@ -331,26 +331,26 @@ describe "Recipe DSL methods" do
it "and os = linux, another_no_name_thingy6 does not work" do
expect_converge {
# this is an ugly way to test, make Cheffish expose node attrs
- run_context.node.automatic[:os] = 'linux'
- another_no_name_thingy6 'blah' do; end
+ run_context.node.automatic[:os] = "linux"
+ another_no_name_thingy6 "blah" do; end
}.to raise_error(Chef::Exceptions::NoSuchResourceType)
end
it "and os = blarghle, another_no_name_thingy6 works" do
recipe = converge {
# this is an ugly way to test, make Cheffish expose node attrs
- run_context.node.automatic[:os] = 'blarghle'
- another_no_name_thingy6 'blah' do; end
+ run_context.node.automatic[:os] = "blarghle"
+ another_no_name_thingy6 "blah" do; end
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_resource).to eq (AnotherNoNameThingy6)
end
it "the new resource name can be used in a recipe" do
recipe = converge {
- another_thingy_name_for_another_no_name_thingy6 'blah' do; end
+ another_thingy_name_for_another_no_name_thingy6 "blah" do; end
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_resource).to eq (AnotherNoNameThingy6)
end
end
@@ -360,7 +360,7 @@ describe "Recipe DSL methods" do
class AnotherNoNameThingy7 < BaseThingy
resource_name :another_thingy_name_for_another_no_name_thingy7
- provides :another_thingy_name_for_another_no_name_thingy7, os: 'blarghle'
+ provides :another_thingy_name_for_another_no_name_thingy7, os: "blarghle"
end
}
@@ -368,26 +368,26 @@ describe "Recipe DSL methods" do
it "and os = linux, another_thingy_name_for_another_no_name_thingy7 does not work" do
expect_converge {
# this is an ugly way to test, make Cheffish expose node attrs
- run_context.node.automatic[:os] = 'linux'
- another_thingy_name_for_another_no_name_thingy7 'blah' do; end
+ run_context.node.automatic[:os] = "linux"
+ another_thingy_name_for_another_no_name_thingy7 "blah" do; end
}.to raise_error(Chef::Exceptions::NoSuchResourceType)
end
it "and os = blarghle, another_thingy_name_for_another_no_name_thingy7 works" do
recipe = converge {
# this is an ugly way to test, make Cheffish expose node attrs
- run_context.node.automatic[:os] = 'blarghle'
- another_thingy_name_for_another_no_name_thingy7 'blah' do; end
+ run_context.node.automatic[:os] = "blarghle"
+ another_thingy_name_for_another_no_name_thingy7 "blah" do; end
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_resource).to eq (AnotherNoNameThingy7)
end
it "the old resource name does not work" do
expect_converge {
# this is an ugly way to test, make Cheffish expose node attrs
- run_context.node.automatic[:os] = 'linux'
- another_no_name_thingy_7 'blah' do; end
+ run_context.node.automatic[:os] = "linux"
+ another_no_name_thingy_7 "blah" do; end
}.to raise_error(NoMethodError)
end
end
@@ -397,7 +397,7 @@ describe "Recipe DSL methods" do
before(:context) {
class AnotherNoNameThingy8 < BaseThingy
- provides :another_thingy_name_for_another_no_name_thingy8, os: 'blarghle'
+ provides :another_thingy_name_for_another_no_name_thingy8, os: "blarghle"
resource_name :another_thingy_name_for_another_no_name_thingy8
end
@@ -406,26 +406,26 @@ describe "Recipe DSL methods" do
it "and os = linux, another_thingy_name_for_another_no_name_thingy8 does not work" do
expect_converge {
# this is an ugly way to test, make Cheffish expose node attrs
- run_context.node.automatic[:os] = 'linux'
- another_thingy_name_for_another_no_name_thingy8 'blah' do; end
+ run_context.node.automatic[:os] = "linux"
+ another_thingy_name_for_another_no_name_thingy8 "blah" do; end
}.to raise_error(Chef::Exceptions::NoSuchResourceType)
end
it "and os = blarghle, another_thingy_name_for_another_no_name_thingy8 works" do
recipe = converge {
# this is an ugly way to test, make Cheffish expose node attrs
- run_context.node.automatic[:os] = 'blarghle'
- another_thingy_name_for_another_no_name_thingy8 'blah' do; end
+ run_context.node.automatic[:os] = "blarghle"
+ another_thingy_name_for_another_no_name_thingy8 "blah" do; end
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_resource).to eq (AnotherNoNameThingy8)
end
it "the old resource name does not work" do
expect_converge {
# this is an ugly way to test, make Cheffish expose node attrs
- run_context.node.automatic[:os] = 'linux'
- another_thingy_name8 'blah' do; end
+ run_context.node.automatic[:os] = "linux"
+ another_thingy_name8 "blah" do; end
}.to raise_error(NoMethodError)
end
end
@@ -444,13 +444,13 @@ describe "Recipe DSL methods" do
it "my_supplier does not work in a recipe" do
expect_converge {
- my_supplier 'blah' do; end
+ my_supplier "blah" do; end
}.to raise_error(NoMethodError)
end
it "hemlock works in a recipe" do
expect_recipe {
- hemlock 'blah' do; end
+ hemlock "blah" do; end
}.to emit_no_warnings_or_errors
expect(BaseThingy.created_resource).to eq RecipeDSLSpecNamespace::MySupplier
end
@@ -467,7 +467,7 @@ describe "Recipe DSL methods" do
it "thingy3 works in a recipe" do
expect_recipe {
- thingy3 'blah' do; end
+ thingy3 "blah" do; end
}.to emit_no_warnings_or_errors
expect(BaseThingy.created_resource).to eq RecipeDSLSpecNamespace::Thingy3
end
@@ -483,14 +483,14 @@ describe "Recipe DSL methods" do
it "thingy3 works in a recipe and yields Thingy3 (the alphabetical one)" do
recipe = converge {
- thingy3 'blah' do; end
+ thingy3 "blah" do; end
}
expect(BaseThingy.created_resource).to eq RecipeDSLSpecNamespace::Thingy3
end
it "thingy4 does not work in a recipe" do
expect_converge {
- thingy4 'blah' do; end
+ thingy4 "blah" do; end
}.to raise_error(NoMethodError)
end
@@ -514,7 +514,7 @@ describe "Recipe DSL methods" do
it "thingy5 works in a recipe" do
expect_recipe {
- thingy5 'blah' do; end
+ thingy5 "blah" do; end
}.to emit_no_warnings_or_errors
expect(BaseThingy.created_resource).to eq RecipeDSLSpecNamespace::Thingy5
end
@@ -531,14 +531,14 @@ describe "Recipe DSL methods" do
it "thingy6 works in a recipe and yields Thingy6" do
recipe = converge {
- thingy6 'blah' do; end
+ thingy6 "blah" do; end
}
expect(BaseThingy.created_resource).to eq RecipeDSLSpecNamespace::Thingy6
end
it "thingy5 works in a recipe and yields Foo::Thingy5 (the alphabetical one)" do
recipe = converge {
- thingy5 'blah' do; end
+ thingy5 "blah" do; end
}
expect(BaseThingy.created_resource).to eq RecipeDSLSpecNamespace::Thingy5
end
@@ -558,7 +558,7 @@ describe "Recipe DSL methods" do
it "thingy5reverse works in a recipe and yields AThingy5 (the alphabetical one)" do
recipe = converge {
- thingy5reverse 'blah' do; end
+ thingy5reverse "blah" do; end
}
expect(BaseThingy.created_resource).to eq RecipeDSLSpecNamespace::AThingy5
end
@@ -577,7 +577,7 @@ describe "Recipe DSL methods" do
it "thingy5_2 works in a recipe and yields the RecipeDSLSpaceNamespace one (the alphabetical one)" do
recipe = converge {
- thingy5_2 'blah' do; end
+ thingy5_2 "blah" do; end
}
expect(BaseThingy.created_resource).to eq RecipeDSLSpecNamespace::Thingy5
end
@@ -596,7 +596,7 @@ describe "Recipe DSL methods" do
it "thingy5_2reverse works in a recipe and yields the ARecipeDSLSpaceNamespace one (the alphabetical one)" do
recipe = converge {
- thingy5_2reverse 'blah' do; end
+ thingy5_2reverse "blah" do; end
}
expect(BaseThingy.created_resource).to eq ARecipeDSLSpecNamespace::Thingy5
end
@@ -614,7 +614,7 @@ describe "Recipe DSL methods" do
it "thingy3 works in a recipe" do
expect_recipe {
- thingy3 'blah' do; end
+ thingy3 "blah" do; end
}.to emit_no_warnings_or_errors
expect(BaseThingy.created_resource).to eq RecipeDSLSpecNamespace::Thingy3
end
@@ -630,14 +630,14 @@ describe "Recipe DSL methods" do
it "thingy3 works in a recipe and yields Thingy3 (the alphabetical one)" do
recipe = converge {
- thingy3 'blah' do; end
+ thingy3 "blah" do; end
}
expect(BaseThingy.created_resource).to eq RecipeDSLSpecNamespace::Thingy3
end
it "thingy4 does not work in a recipe" do
expect_converge {
- thingy4 'blah' do; end
+ thingy4 "blah" do; end
}.to raise_error(NoMethodError)
end
@@ -657,14 +657,14 @@ describe "Recipe DSL methods" do
it "thingy3 works in a recipe and yields Thingy3 (the alphabetical one)" do
recipe = converge {
- thingy3 'blah' do; end
+ thingy3 "blah" do; end
}
expect(BaseThingy.created_resource).to eq RecipeDSLSpecNamespace::Thingy3
end
it "thingy4 does not work in a recipe" do
expect_converge {
- thingy4 'blah' do; end
+ thingy4 "blah" do; end
}.to raise_error(NoMethodError)
end
@@ -697,14 +697,14 @@ describe "Recipe DSL methods" do
it "thingy7 works in a recipe and yields Thingy7" do
recipe = converge {
- thingy7 'blah' do; end
+ thingy7 "blah" do; end
}
expect(BaseThingy.created_resource).to eq RecipeDSLSpecNamespace::Thingy7
end
it "thingy8 works in a recipe and yields Thingy7 (alphabetical)" do
recipe = converge {
- thingy8 'blah' do; end
+ thingy8 "blah" do; end
}
expect(BaseThingy.created_resource).to eq RecipeDSLSpecNamespace::Thingy7
end
@@ -728,21 +728,21 @@ describe "Recipe DSL methods" do
it "thingy12 works in a recipe and yields Thingy12" do
expect_recipe {
- thingy12 'blah' do; end
+ thingy12 "blah" do; end
}.to emit_no_warnings_or_errors
expect(BaseThingy.created_resource).to eq RecipeDSLSpecNamespace::Thingy12
end
it "twizzle works in a recipe and yields Thingy12" do
expect_recipe {
- twizzle 'blah' do; end
+ twizzle "blah" do; end
}.to emit_no_warnings_or_errors
expect(BaseThingy.created_resource).to eq RecipeDSLSpecNamespace::Thingy12
end
it "twizzle2 works in a recipe and yields Thingy12" do
expect_recipe {
- twizzle2 'blah' do; end
+ twizzle2 "blah" do; end
}.to emit_no_warnings_or_errors
expect(BaseThingy.created_resource).to eq RecipeDSLSpecNamespace::Thingy12
end
@@ -752,20 +752,20 @@ describe "Recipe DSL methods" do
before(:context) {
class MySuperThingyFoo < BaseThingy
resource_name :my_super_thingy_foo
- provides :my_super_thingy, platform: 'foo'
+ provides :my_super_thingy, platform: "foo"
end
class MySuperThingyBar < BaseThingy
resource_name :my_super_thingy_bar
- provides :my_super_thingy, platform: 'bar'
+ provides :my_super_thingy, platform: "bar"
end
}
it "A run with platform 'foo' uses MySuperThingyFoo" do
r = Cheffish::ChefRun.new(chef_config)
- r.client.run_context.node.automatic['platform'] = 'foo'
+ r.client.run_context.node.automatic["platform"] = "foo"
r.compile_recipe {
- my_super_thingy 'blah' do; end
+ my_super_thingy "blah" do; end
}
r.converge
expect(r).to emit_no_warnings_or_errors
@@ -774,9 +774,9 @@ describe "Recipe DSL methods" do
it "A run with platform 'bar' uses MySuperThingyBar" do
r = Cheffish::ChefRun.new(chef_config)
- r.client.run_context.node.automatic['platform'] = 'bar'
+ r.client.run_context.node.automatic["platform"] = "bar"
r.compile_recipe {
- my_super_thingy 'blah' do; end
+ my_super_thingy "blah" do; end
}
r.converge
expect(r).to emit_no_warnings_or_errors
@@ -785,10 +785,10 @@ describe "Recipe DSL methods" do
it "A run with platform 'x' reports that my_super_thingy is not supported" do
r = Cheffish::ChefRun.new(chef_config)
- r.client.run_context.node.automatic['platform'] = 'x'
+ r.client.run_context.node.automatic["platform"] = "x"
expect {
r.compile_recipe {
- my_super_thingy 'blah' do; end
+ my_super_thingy "blah" do; end
}
}.to raise_error(Chef::Exceptions::NoSuchResourceType)
end
@@ -819,7 +819,7 @@ describe "Recipe DSL methods" do
it "declaring a resource providing the same :thingy11 with os: 'linux' does not produce a warning" do
expect(Chef::Log).not_to receive(:warn)
class RecipeDSLSpecNamespace::Thingy11AlternateProvider < BaseThingy
- provides :thingy11, os: 'linux'
+ provides :thingy11, os: "linux"
end
end
end
@@ -859,7 +859,7 @@ describe "Recipe DSL methods" do
recipe = converge {
instance_eval("#{two_classes_one_dsl} 'blah'")
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_resource).to eq resource_class_a
end
@@ -887,7 +887,7 @@ describe "Recipe DSL methods" do
recipe = converge {
instance_eval("#{two_classes_one_dsl} 'blah'")
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_resource).to eq resource_class
end
@@ -905,7 +905,7 @@ describe "Recipe DSL methods" do
recipe = converge {
instance_eval("#{two_classes_one_dsl} 'blah'")
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_resource).to eq resource_class_z
end
@@ -923,7 +923,7 @@ describe "Recipe DSL methods" do
recipe = converge {
instance_eval("#{two_classes_one_dsl} 'blah'")
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_resource).to eq resource_class
end
@@ -944,7 +944,7 @@ describe "Recipe DSL methods" do
recipe = converge {
instance_eval("#{two_classes_one_dsl} 'blah'")
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_resource).to eq resource_class_z
end
@@ -962,7 +962,7 @@ describe "Recipe DSL methods" do
recipe = converge {
instance_eval("#{two_classes_one_dsl} 'blah'")
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_resource).to eq resource_class
end
@@ -987,7 +987,7 @@ describe "Recipe DSL methods" do
recipe = converge {
instance_eval("#{two_classes_one_dsl} 'blah'")
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_resource).to eq resource_class
end
@@ -1036,7 +1036,7 @@ describe "Recipe DSL methods" do
recipe = converge {
instance_eval("#{two_classes_one_dsl} 'blah'")
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_provider).to eq provider_class_a
end
end
@@ -1048,7 +1048,7 @@ describe "Recipe DSL methods" do
recipe = converge {
instance_eval("#{two_classes_one_dsl} 'blah'")
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_provider).to eq provider_class
end
end
@@ -1075,7 +1075,7 @@ describe "Recipe DSL methods" do
recipe = converge {
instance_eval("#{two_classes_one_dsl} 'blah'")
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_provider).to eq provider_class
end
@@ -1087,7 +1087,7 @@ describe "Recipe DSL methods" do
recipe = converge {
instance_eval("#{two_classes_one_dsl} 'blah'")
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_provider).to eq provider_class_z
end
end
@@ -1104,7 +1104,7 @@ describe "Recipe DSL methods" do
recipe = converge {
instance_eval("#{two_classes_one_dsl} 'blah'")
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_provider).to eq provider_class
end
end
@@ -1118,7 +1118,7 @@ describe "Recipe DSL methods" do
recipe = converge {
instance_eval("#{two_classes_one_dsl} 'blah'")
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_provider).to eq provider_class
end
end
@@ -1136,7 +1136,7 @@ describe "Recipe DSL methods" do
def self.inspect; name.inspect; end
end
result.resource_name two_classes_one_dsl
- result.provides two_classes_one_dsl, os: 'blarghle'
+ result.provides two_classes_one_dsl, os: "blarghle"
result
}
before { resource_class_blarghle } # pull on it so it gets defined before the recipe runs
@@ -1145,10 +1145,10 @@ describe "Recipe DSL methods" do
two_classes_one_dsl = self.two_classes_one_dsl
recipe = converge {
# this is an ugly way to test, make Cheffish expose node attrs
- run_context.node.automatic[:os] = 'blarghle'
+ run_context.node.automatic[:os] = "blarghle"
instance_eval("#{two_classes_one_dsl} 'blah' do; end")
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_resource).to eq resource_class_blarghle
end
@@ -1156,10 +1156,10 @@ describe "Recipe DSL methods" do
two_classes_one_dsl = self.two_classes_one_dsl
recipe = converge {
# this is an ugly way to test, make Cheffish expose node attrs
- run_context.node.automatic[:os] = 'linux'
+ run_context.node.automatic[:os] = "linux"
instance_eval("#{two_classes_one_dsl} 'blah' do; end")
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_resource).to eq resource_class
end
end
@@ -1196,7 +1196,7 @@ describe "Recipe DSL methods" do
recipe = converge {
instance_eval("#{dsl_name} 'foo'")
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_resource).to eq resource_class
expect(resource_class.called_provides).to be_truthy
end
@@ -1264,7 +1264,7 @@ describe "Recipe DSL methods" do
recipe = converge {
instance_eval("#{my_resource} 'foo'")
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_provider).to eq provider_class
end
@@ -1291,7 +1291,7 @@ describe "Recipe DSL methods" do
recipe = converge {
instance_eval("#{my_resource} 'foo'")
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_provider).to eq provider_class
end
end
@@ -1308,7 +1308,7 @@ describe "Recipe DSL methods" do
recipe = converge {
instance_eval("#{my_resource} 'foo'")
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_provider).to eq provider_class
end
@@ -1337,7 +1337,7 @@ describe "Recipe DSL methods" do
recipe = converge {
instance_eval("#{my_resource} 'foo'")
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_provider).to eq provider_class2
end
end
@@ -1363,7 +1363,7 @@ describe "Recipe DSL methods" do
recipe = converge {
instance_eval("#{my_resource} 'foo'")
}
- expect(recipe.logged_warnings).to eq ''
+ expect(recipe.logged_warnings).to eq ""
expect(BaseThingy.created_provider).to eq provider_class
expect(provider_class.called_provides).to be_truthy
end
@@ -1484,7 +1484,7 @@ describe "Recipe DSL methods" do
it "looks up the provider in Chef::Provider converting the resource name from snake case to camel case" do
resource = nil
recipe = converge {
- resource = lw_resource_with_hw_provider_test_case 'blah' do; end
+ resource = lw_resource_with_hw_provider_test_case "blah" do; end
}
expect(resource.created_provider).to eq(Chef::Provider::LwResourceWithHwProviderTestCase)
end
diff --git a/spec/integration/recipes/remote_directory.rb b/spec/integration/recipes/remote_directory.rb
index a1988ccd52..77fe183136 100644
--- a/spec/integration/recipes/remote_directory.rb
+++ b/spec/integration/recipes/remote_directory.rb
@@ -1,4 +1,4 @@
-require 'support/shared/integration/integration_helper'
+require "support/shared/integration/integration_helper"
describe Chef::Resource::RemoteDirectory do
include IntegrationSupport
@@ -20,7 +20,7 @@ describe Chef::Resource::RemoteDirectory do
when_the_repository "has a cookbook with a source_dir with two subdirectories, each with one file and subdir in a different alphabetical order" do
before do
- file 'config/client.rb', <<-EOM
+ file "config/client.rb", <<-EOM
local_mode true
cookbook_path "#{path_to('cookbooks')}"
EOM
diff --git a/spec/integration/recipes/resource_action_spec.rb b/spec/integration/recipes/resource_action_spec.rb
index 17a1eb9acd..b8c533b31d 100644
--- a/spec/integration/recipes/resource_action_spec.rb
+++ b/spec/integration/recipes/resource_action_spec.rb
@@ -1,4 +1,4 @@
-require 'support/shared/integration/integration_helper'
+require "support/shared/integration/integration_helper"
# Houses any classes we declare
module ResourceActionSpec
@@ -36,7 +36,7 @@ describe "Resource.action" do
end
EOM
expect(ActionJackson.ran_action).to eq :access_attribute
- expect(ActionJackson.succeeded).to eq 'foo!'
+ expect(ActionJackson.succeeded).to eq "foo!"
end
it "the action can access public methods" do
@@ -47,7 +47,7 @@ describe "Resource.action" do
end
EOM
expect(ActionJackson.ran_action).to eq :access_method
- expect(ActionJackson.succeeded).to eq 'foo_public!'
+ expect(ActionJackson.succeeded).to eq "foo_public!"
end
it "the action can access protected methods" do
@@ -58,7 +58,7 @@ describe "Resource.action" do
end
EOM
expect(ActionJackson.ran_action).to eq :access_protected_method
- expect(ActionJackson.succeeded).to eq 'foo_protected!'
+ expect(ActionJackson.succeeded).to eq "foo_protected!"
end
it "the action cannot access private methods" do
@@ -98,7 +98,7 @@ describe "Resource.action" do
end
EOM
expect(ActionJackson.ran_action).to eq :access_class_method
- expect(ActionJackson.succeeded).to eq 'ruby_block_converged!'
+ expect(ActionJackson.succeeded).to eq "ruby_block_converged!"
end
it "the action's resources converge before the next resource converges" do
@@ -115,8 +115,8 @@ describe "Resource.action" do
end
EOM
expect(ActionJackson.ran_action).to eq :access_attribute
- expect(ActionJackson.succeeded).to eq 'foo!'
- expect(ActionJackson.ruby_block_converged).to eq 'foo!'
+ expect(ActionJackson.succeeded).to eq "foo!"
+ expect(ActionJackson.ruby_block_converged).to eq "foo!"
end
end
@@ -140,21 +140,21 @@ describe "Resource.action" do
public
def foo_public
- 'foo_public!'
+ "foo_public!"
end
protected
def foo_protected
- 'foo_protected!'
+ "foo_protected!"
end
private
def foo_private
- 'foo_private!'
+ "foo_private!"
end
public
action :access_recipe_dsl do
ActionJackson.ran_action = :access_recipe_dsl
- ruby_block 'hi there' do
+ ruby_block "hi there" do
block do
ActionJackson.succeeded = true
end
@@ -205,7 +205,7 @@ describe "Resource.action" do
end
it "Can retrieve ancestors of action class without crashing" do
- converge { action_jackson 'hi' }
+ converge { action_jackson "hi" }
expect { ActionJackson.action_class.ancestors.join(",") }.not_to raise_error
end
@@ -260,9 +260,9 @@ describe "Resource.action" do
it "the default action remains the same even though new actions were specified first" do
converge {
- action_jackalope 'hi' do
- foo 'foo!'
- bar 'bar!'
+ action_jackalope "hi" do
+ foo "foo!"
+ bar "bar!"
end
}
expect(ActionJackson.ran_action).to eq :access_recipe_dsl
@@ -271,10 +271,10 @@ describe "Resource.action" do
it "new actions run, and can access overridden, new, and overridden attributes" do
converge {
- action_jackalope 'hi' do
- foo 'foo!'
- bar 'bar!'
- blarghle 'blarghle!'
+ action_jackalope "hi" do
+ foo "foo!"
+ bar "bar!"
+ blarghle "blarghle!"
action :access_jackalope
end
}
@@ -284,10 +284,10 @@ describe "Resource.action" do
it "overridden actions run, call super, and can access overridden, new, and overridden attributes" do
converge {
- action_jackalope 'hi' do
- foo 'foo!'
- bar 'bar!'
- blarghle 'blarghle!'
+ action_jackalope "hi" do
+ foo "foo!"
+ bar "bar!"
+ blarghle "blarghle!"
action :access_attribute
end
}
@@ -299,10 +299,10 @@ describe "Resource.action" do
it "non-overridden actions run and can access overridden and non-overridden variables (but not necessarily new ones)" do
converge {
- action_jackalope 'hi' do
- foo 'foo!'
- bar 'bar!'
- blarghle 'blarghle!'
+ action_jackalope "hi" do
+ foo "foo!"
+ bar "bar!"
+ blarghle "blarghle!"
action :access_attribute2
end
}
@@ -328,8 +328,8 @@ describe "Resource.action" do
it "the default action is :nothing" do
converge {
- no_action_jackson 'hi' do
- foo 'foo!'
+ no_action_jackson "hi" do
+ foo "foo!"
NoActionJackson.action_was = action
end
}
@@ -352,7 +352,7 @@ describe "Resource.action" do
it "Running the action works" do
expect_recipe {
- weird_action_jackson 'hi'
+ weird_action_jackson "hi"
}.to be_up_to_date
expect(WeirdActionJackson.action_was).to eq :"a-b-c d"
end
@@ -373,7 +373,7 @@ describe "Resource.action" do
resource_name :resource_action_spec_also_with_x
property :x
action :set_x_to_x do
- resource_action_spec_with_x 'hi' do
+ resource_action_spec_with_x "hi" do
x x
end
end
@@ -381,13 +381,13 @@ describe "Resource.action" do
__LINE__-4
end
action :set_x_to_x_in_non_initializer do
- r = resource_action_spec_with_x 'hi' do
+ r = resource_action_spec_with_x "hi" do
x 10
end
x_times_2 = r.x*2
end
action :set_x_to_10 do
- resource_action_spec_with_x 'hi' do
+ resource_action_spec_with_x "hi" do
x 10
end
end
@@ -397,7 +397,7 @@ describe "Resource.action" do
it "Using the enclosing resource to set x to x emits a warning that you're using the wrong x" do
recipe = converge {
- resource_action_spec_also_with_x 'hi' do
+ resource_action_spec_also_with_x "hi" do
x 1
action :set_x_to_x
end
@@ -409,7 +409,7 @@ describe "Resource.action" do
it "Using the enclosing resource to set x to x outside the initializer emits no warning" do
expect_recipe {
- resource_action_spec_also_with_x 'hi' do
+ resource_action_spec_also_with_x "hi" do
x 1
action :set_x_to_x_in_non_initializer
end
@@ -418,7 +418,7 @@ describe "Resource.action" do
it "Using the enclosing resource to set x to 10 emits no warning" do
expect_recipe {
- resource_action_spec_also_with_x 'hi' do
+ resource_action_spec_also_with_x "hi" do
x 1
action :set_x_to_10
end
@@ -427,7 +427,7 @@ describe "Resource.action" do
it "Using the enclosing resource to set x to 10 emits no warning" do
expect_recipe {
- r = resource_action_spec_also_with_x 'hi'
+ r = resource_action_spec_also_with_x "hi"
r.x 1
r.action :set_x_to_10
}.to emit_no_warnings_or_errors
@@ -442,14 +442,14 @@ describe "Resource.action" do
property :template
action :create do
template "x" do
- 'blah'
+ "blah"
end
end
end
it "Raises an error when attempting to use a template in the action" do
expect_converge {
- has_property_named_template 'hi'
+ has_property_named_template "hi"
}.to raise_error(/Property template of has_property_named_template\[hi\] cannot be passed a block! If you meant to create a resource named template instead, you'll need to first rename the property./)
end
end
@@ -484,16 +484,16 @@ describe "Resource.action" do
end
it "the methods are not available on the resource" do
- expect { DeclaresActionClassMethods.new('hi').a }.to raise_error(NameError)
- expect { DeclaresActionClassMethods.new('hi').b }.to raise_error(NameError)
- expect { DeclaresActionClassMethods.new('hi').c }.to raise_error(NameError)
- expect { DeclaresActionClassMethods.new('hi').d }.to raise_error(NameError)
+ expect { DeclaresActionClassMethods.new("hi").a }.to raise_error(NameError)
+ expect { DeclaresActionClassMethods.new("hi").b }.to raise_error(NameError)
+ expect { DeclaresActionClassMethods.new("hi").c }.to raise_error(NameError)
+ expect { DeclaresActionClassMethods.new("hi").d }.to raise_error(NameError)
end
it "the methods are available to the action" do
r = nil
expect_recipe {
- r = declares_action_class_methods 'hi'
+ r = declares_action_class_methods "hi"
}.to emit_no_warnings_or_errors
expect(r.x).to eq(10)
end
@@ -512,17 +512,17 @@ describe "Resource.action" do
end
it "the methods are not available on the resource" do
- expect { DeclaresActionClassMethods.new('hi').a }.to raise_error(NameError)
- expect { DeclaresActionClassMethods.new('hi').b }.to raise_error(NameError)
- expect { DeclaresActionClassMethods.new('hi').c }.to raise_error(NameError)
- expect { DeclaresActionClassMethods.new('hi').d }.to raise_error(NameError)
- expect { DeclaresActionClassMethods.new('hi').e }.to raise_error(NameError)
+ expect { DeclaresActionClassMethods.new("hi").a }.to raise_error(NameError)
+ expect { DeclaresActionClassMethods.new("hi").b }.to raise_error(NameError)
+ expect { DeclaresActionClassMethods.new("hi").c }.to raise_error(NameError)
+ expect { DeclaresActionClassMethods.new("hi").d }.to raise_error(NameError)
+ expect { DeclaresActionClassMethods.new("hi").e }.to raise_error(NameError)
end
it "the methods are available to the action" do
r = nil
expect_recipe {
- r = declares_action_class_methods_too 'hi'
+ r = declares_action_class_methods_too "hi"
}.to emit_no_warnings_or_errors
expect(r.x).to eq(15)
end
diff --git a/spec/integration/recipes/resource_converge_if_changed_spec.rb b/spec/integration/recipes/resource_converge_if_changed_spec.rb
index f3b562c50d..2bcccd9831 100644
--- a/spec/integration/recipes/resource_converge_if_changed_spec.rb
+++ b/spec/integration/recipes/resource_converge_if_changed_spec.rb
@@ -1,4 +1,4 @@
-require 'support/shared/integration/integration_helper'
+require "support/shared/integration/integration_helper"
describe "Resource::ActionClass#converge_if_changed" do
include IntegrationSupport
@@ -23,10 +23,10 @@ describe "Resource::ActionClass#converge_if_changed" do
result = Class.new(Chef::Resource) do
def self.to_s; resource_name; end
def self.inspect; resource_name.inspect; end
- property :identity1, identity: true, default: 'default_identity1'
- property :control1, desired_state: false, default: 'default_control1'
- property :state1, default: 'default_state1'
- property :state2, default: 'default_state2'
+ property :identity1, identity: true, default: "default_identity1"
+ property :control1, desired_state: false, default: "default_control1"
+ property :state1, default: "default_state1"
+ property :state2, default: "default_state2"
attr_accessor :converged
def initialize(*args)
super
@@ -51,8 +51,8 @@ describe "Resource::ActionClass#converge_if_changed" do
context "and current_resource with state1=current, state2=current" do
before :each do
resource_class.load_current_value do
- state1 'current_state1'
- state2 'current_state2'
+ state1 "current_state1"
+ state2 "current_state2"
end
end
@@ -198,8 +198,8 @@ EOM
context "and current_resource with identity1=current, control1=current" do
before :each do
resource_class.load_current_value do
- identity1 'current_identity1'
- control1 'current_control1'
+ identity1 "current_identity1"
+ control1 "current_control1"
end
end
@@ -314,8 +314,8 @@ EOM
context "and current_resource with state1=current, state2=current" do
before :each do
resource_class.load_current_value do
- state1 'current_state1'
- state2 'current_state2'
+ state1 "current_state1"
+ state2 "current_state2"
end
end
diff --git a/spec/integration/recipes/resource_load_spec.rb b/spec/integration/recipes/resource_load_spec.rb
index 556201efd8..66a36b1431 100644
--- a/spec/integration/recipes/resource_load_spec.rb
+++ b/spec/integration/recipes/resource_load_spec.rb
@@ -1,4 +1,4 @@
-require 'support/shared/integration/integration_helper'
+require "support/shared/integration/integration_helper"
describe "Resource.load_current_value" do
include IntegrationSupport
@@ -55,29 +55,29 @@ describe "Resource.load_current_value" do
e = self
r = nil
converge {
- r = public_send(e.resource_name, 'blah') do
- x 'desired'
+ r = public_send(e.resource_name, "blah") do
+ x "desired"
end
}
r
end
it "current_resource is passed name but not x" do
- expect(resource.current_value.x).to eq 'loaded 2 (name=blah)'
+ expect(resource.current_value.x).to eq "loaded 2 (name=blah)"
end
it "resource.current_value returns a different resource" do
- expect(resource.current_value.x).to eq 'loaded 2 (name=blah)'
- expect(resource.x).to eq 'desired'
+ expect(resource.current_value.x).to eq "loaded 2 (name=blah)"
+ expect(resource.x).to eq "desired"
end
it "resource.current_value constructs the resource anew each time" do
- expect(resource.current_value.x).to eq 'loaded 2 (name=blah)'
- expect(resource.current_value.x).to eq 'loaded 3 (name=blah)'
+ expect(resource.current_value.x).to eq "loaded 2 (name=blah)"
+ expect(resource.current_value.x).to eq "loaded 3 (name=blah)"
end
it "the provider accesses the current value of x" do
- expect(resource.class.created_x).to eq 'desired'
+ expect(resource.class.created_x).to eq "desired"
end
context "and identity: :i and :d with desired_state: false" do
@@ -89,12 +89,12 @@ describe "Resource.load_current_value" do
}
before {
- resource.i 'desired_i'
- resource.d 'desired_d'
+ resource.i "desired_i"
+ resource.d "desired_d"
}
it "i, name and d are passed to load_current_value, but not x" do
- expect(resource.current_value.x).to eq 'loaded 2 (d=desired_d, i=desired_i, name=blah)'
+ expect(resource.current_value.x).to eq "loaded 2 (d=desired_d, i=desired_i, name=blah)"
end
end
@@ -107,12 +107,12 @@ describe "Resource.load_current_value" do
}
before {
- resource.i 'desired_i'
- resource.d 'desired_d'
+ resource.i "desired_i"
+ resource.d "desired_d"
}
it "i, name and d are passed to load_current_value, but not x" do
- expect(resource.current_value.x).to eq 'loaded 2 (d=desired_d, i=desired_i, name=blah)'
+ expect(resource.current_value.x).to eq "loaded 2 (d=desired_d, i=desired_i, name=blah)"
end
end
end
@@ -122,14 +122,14 @@ describe "Resource.load_current_value" do
e = self
r = nil
converge {
- r = public_send(e.resource_name, 'blah') do
+ r = public_send(e.resource_name, "blah") do
end
}
r
end
it "the provider accesses values from load_current_value" do
- expect(resource.class.created_x).to eq 'loaded 1 (name=blah)'
+ expect(resource.class.created_x).to eq "loaded 1 (name=blah)"
end
end
@@ -151,8 +151,8 @@ describe "Resource.load_current_value" do
e = self
r = nil
converge {
- r = public_send(e.subresource_name, 'blah') do
- x 'desired'
+ r = public_send(e.subresource_name, "blah") do
+ x "desired"
end
}
r
@@ -160,7 +160,7 @@ describe "Resource.load_current_value" do
context "and a child resource class with no load_current_value" do
it "the parent load_current_value is used" do
- expect(subresource.current_value.x).to eq 'loaded 2 (name=blah)'
+ expect(subresource.current_value.x).to eq "loaded 2 (name=blah)"
end
it "load_current_value yields a copy of the child class" do
expect(subresource.current_value).to be_kind_of(subresource_class)
@@ -179,8 +179,8 @@ describe "Resource.load_current_value" do
it "the overridden load_current_value is used" do
current_resource = subresource.current_value
- expect(current_resource.x).to eq 'default 3'
- expect(current_resource.y).to eq 'loaded_y 2 (name=blah)'
+ expect(current_resource.x).to eq "default 3"
+ expect(current_resource.y).to eq "loaded_y 2 (name=blah)"
end
end
@@ -197,8 +197,8 @@ describe "Resource.load_current_value" do
it "the original load_current_value is called as well as the child one" do
current_resource = subresource.current_value
- expect(current_resource.x).to eq 'loaded 3 (name=blah)'
- expect(current_resource.y).to eq 'loaded_y 4 (name=blah, x=loaded 3 (name=blah))'
+ expect(current_resource.x).to eq "loaded 3 (name=blah)"
+ expect(current_resource.y).to eq "loaded_y 4 (name=blah, x=loaded 3 (name=blah))"
end
end
end