diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2017-02-13 09:52:10 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2017-02-13 09:52:10 -0800 |
commit | 404a9bc88be538769c6c80b3b31f39a6582991d2 (patch) | |
tree | 2f8795e5f64153440c22a522d669c235a627f289 /spec/integration | |
parent | b949a48acc21d4b64869bd7b834708d5232b1f2a (diff) | |
download | chef-404a9bc88be538769c6c80b3b31f39a6582991d2.tar.gz |
fix specs: RedundantReturn, RedundantSelf, RedundantBegin
department of redundancy department
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/integration')
-rw-r--r-- | spec/integration/recipes/recipe_dsl_spec.rb | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/spec/integration/recipes/recipe_dsl_spec.rb b/spec/integration/recipes/recipe_dsl_spec.rb index ce784b11ca..370d202678 100644 --- a/spec/integration/recipes/recipe_dsl_spec.rb +++ b/spec/integration/recipes/recipe_dsl_spec.rb @@ -861,7 +861,7 @@ describe "Recipe DSL methods" do before { resource_class_a } # pull on it so it gets defined before the recipe runs it "two_classes_one_dsl resolves to A (alphabetically earliest)" do - two_classes_one_dsl = self.two_classes_one_dsl + two_classes_one_dsl = two_classes_one_dsl recipe = converge do instance_eval("#{two_classes_one_dsl} 'blah'") end @@ -891,7 +891,7 @@ describe "Recipe DSL methods" do before { resource_class_z } # pull on it so it gets defined before the recipe runs it "two_classes_one_dsl resolves to B (alphabetically earliest)" do - two_classes_one_dsl = self.two_classes_one_dsl + two_classes_one_dsl = two_classes_one_dsl recipe = converge do instance_eval("#{two_classes_one_dsl} 'blah'") end @@ -909,7 +909,7 @@ describe "Recipe DSL methods" do end it "two_classes_one_dsl resolves to Z (respects the priority array)" do - two_classes_one_dsl = self.two_classes_one_dsl + two_classes_one_dsl = two_classes_one_dsl recipe = converge do instance_eval("#{two_classes_one_dsl} 'blah'") end @@ -927,7 +927,7 @@ describe "Recipe DSL methods" do end it "two_classes_one_dsl resolves to B (picks the next thing in the priority array)" do - two_classes_one_dsl = self.two_classes_one_dsl + two_classes_one_dsl = two_classes_one_dsl recipe = converge do instance_eval("#{two_classes_one_dsl} 'blah'") end @@ -948,7 +948,7 @@ describe "Recipe DSL methods" do end it "two_classes_one_dsl resolves to Z (respects the most recent priority array)" do - two_classes_one_dsl = self.two_classes_one_dsl + two_classes_one_dsl = two_classes_one_dsl recipe = converge do instance_eval("#{two_classes_one_dsl} 'blah'") end @@ -966,7 +966,7 @@ describe "Recipe DSL methods" do end it "two_classes_one_dsl resolves to B (picks the first match from the other priority array)" do - two_classes_one_dsl = self.two_classes_one_dsl + two_classes_one_dsl = two_classes_one_dsl recipe = converge do instance_eval("#{two_classes_one_dsl} 'blah'") end @@ -991,7 +991,7 @@ describe "Recipe DSL methods" do end it "two_classes_one_dsl resolves to B (picks the first match outside the priority array)" do - two_classes_one_dsl = self.two_classes_one_dsl + two_classes_one_dsl = two_classes_one_dsl recipe = converge do instance_eval("#{two_classes_one_dsl} 'blah'") end @@ -1044,7 +1044,7 @@ describe "Recipe DSL methods" do before { provider_class_a.provides two_classes_one_dsl } it "two_classes_one_dsl resolves to A (alphabetically earliest)" do - two_classes_one_dsl = self.two_classes_one_dsl + two_classes_one_dsl = two_classes_one_dsl recipe = converge do instance_eval("#{two_classes_one_dsl} 'blah'") end @@ -1056,7 +1056,7 @@ describe "Recipe DSL methods" do before { provider_class_a.provides(two_classes_one_dsl) { false } } it "two_classes_one_dsl resolves to B (since A declined)" do - two_classes_one_dsl = self.two_classes_one_dsl + two_classes_one_dsl = two_classes_one_dsl recipe = converge do instance_eval("#{two_classes_one_dsl} 'blah'") end @@ -1085,7 +1085,7 @@ describe "Recipe DSL methods" do before { provider_class_z.provides two_classes_one_dsl } it "two_classes_one_dsl resolves to B (alphabetically earliest)" do - two_classes_one_dsl = self.two_classes_one_dsl + two_classes_one_dsl = two_classes_one_dsl recipe = converge do instance_eval("#{two_classes_one_dsl} 'blah'") end @@ -1097,7 +1097,7 @@ describe "Recipe DSL methods" do before { Chef.set_provider_priority_array two_classes_one_dsl, [ provider_class_z, provider_class ] } it "two_classes_one_dsl resolves to Z (respects the priority map)" do - two_classes_one_dsl = self.two_classes_one_dsl + two_classes_one_dsl = two_classes_one_dsl recipe = converge do instance_eval("#{two_classes_one_dsl} 'blah'") end @@ -1114,7 +1114,7 @@ describe "Recipe DSL methods" do before { Chef.set_provider_priority_array two_classes_one_dsl, [ provider_class_z, provider_class ] } it "two_classes_one_dsl resolves to B (the next one in the priority map)" do - two_classes_one_dsl = self.two_classes_one_dsl + two_classes_one_dsl = two_classes_one_dsl recipe = converge do instance_eval("#{two_classes_one_dsl} 'blah'") end @@ -1128,7 +1128,7 @@ describe "Recipe DSL methods" do before { Chef.set_provider_priority_array two_classes_one_dsl, [ provider_class ] } it "two_classes_one_dsl resolves to B (the one in the next priority map)" do - two_classes_one_dsl = self.two_classes_one_dsl + two_classes_one_dsl = two_classes_one_dsl recipe = converge do instance_eval("#{two_classes_one_dsl} 'blah'") end @@ -1158,7 +1158,7 @@ describe "Recipe DSL methods" do before { resource_class_blarghle } # pull on it so it gets defined before the recipe runs it "on os = blarghle, two_classes_one_dsl resolves to Blarghle" do - two_classes_one_dsl = self.two_classes_one_dsl + two_classes_one_dsl = two_classes_one_dsl recipe = converge do # this is an ugly way to test, make Cheffish expose node attrs run_context.node.automatic[:os] = "blarghle" @@ -1169,7 +1169,7 @@ describe "Recipe DSL methods" do end it "on os = linux, two_classes_one_dsl resolves to B" do - two_classes_one_dsl = self.two_classes_one_dsl + two_classes_one_dsl = two_classes_one_dsl recipe = converge do # this is an ugly way to test, make Cheffish expose node attrs run_context.node.automatic[:os] = "linux" @@ -1202,7 +1202,7 @@ describe "Recipe DSL methods" do context "with provides? returning true to my_resource" do before do - my_resource = self.my_resource + my_resource = my_resource resource_class.define_singleton_method(:provides?) do |node, resource_name| @called_provides = true resource_name == my_resource @@ -1210,7 +1210,7 @@ describe "Recipe DSL methods" do end it "my_resource returns the resource and calls provides?, but does not emit a warning" do - dsl_name = self.my_resource + dsl_name = my_resource recipe = converge do instance_eval("#{dsl_name} 'foo'") end @@ -1222,7 +1222,7 @@ describe "Recipe DSL methods" do context "with provides? returning true to blarghle_blarghle_little_star and not resource_name" do before do - blarghle_blarghle_little_star = self.blarghle_blarghle_little_star + blarghle_blarghle_little_star = blarghle_blarghle_little_star resource_class.define_singleton_method(:provides?) do |node, resource_name| @called_provides = true resource_name == blarghle_blarghle_little_star @@ -1230,7 +1230,7 @@ describe "Recipe DSL methods" do end it "my_resource does not return the resource" do - dsl_name = self.my_resource + dsl_name = my_resource expect_converge do instance_eval("#{dsl_name} 'foo'") end.to raise_error(Chef::Exceptions::NoSuchResourceType) @@ -1239,7 +1239,7 @@ describe "Recipe DSL methods" do it "blarghle_blarghle_little_star 'foo' returns the resource and emits a warning" do Chef::Config[:treat_deprecation_warnings_as_errors] = false - dsl_name = self.blarghle_blarghle_little_star + dsl_name = blarghle_blarghle_little_star recipe = converge do instance_eval("#{dsl_name} 'foo'") end @@ -1281,7 +1281,7 @@ describe "Recipe DSL methods" do end it "my_resource runs the provider and does not emit a warning" do - my_resource = self.my_resource + my_resource = my_resource recipe = converge do instance_eval("#{my_resource} 'foo'") end @@ -1311,7 +1311,7 @@ describe "Recipe DSL methods" do end it "my_resource runs the first provider" do - my_resource = self.my_resource + my_resource = my_resource recipe = converge do instance_eval("#{my_resource} 'foo'") end @@ -1328,7 +1328,7 @@ describe "Recipe DSL methods" do # TODO no warning? ick it "my_resource runs the provider anyway" do - my_resource = self.my_resource + my_resource = my_resource recipe = converge do instance_eval("#{my_resource} 'foo'") end @@ -1338,7 +1338,7 @@ describe "Recipe DSL methods" do context "and another provider supporting :my_resource with supports? true" do let(:provider_class2) do - my_resource = self.my_resource + my_resource = my_resource Class.new(BaseThingy::Provider) do def self.name "MyProvider2" @@ -1360,7 +1360,7 @@ describe "Recipe DSL methods" do before { provider_class2 } # make sure the provider class shows up it "my_resource runs the other provider" do - my_resource = self.my_resource + my_resource = my_resource recipe = converge do instance_eval("#{my_resource} 'foo'") end @@ -1373,7 +1373,7 @@ describe "Recipe DSL methods" do context "with provides? returning true" do before do - my_resource = self.my_resource + my_resource = my_resource provider_class.define_singleton_method(:provides?) do |node, resource| @called_provides = true resource.declared_type == my_resource @@ -1386,7 +1386,7 @@ describe "Recipe DSL methods" do end it "my_resource calls the provider (and calls provides?), but does not emit a warning" do - my_resource = self.my_resource + my_resource = my_resource recipe = converge do instance_eval("#{my_resource} 'foo'") end @@ -1399,7 +1399,7 @@ describe "Recipe DSL methods" do context "that does not call provides :my_resource" do it "my_resource calls the provider (and calls provides?), and emits a warning" do Chef::Config[:treat_deprecation_warnings_as_errors] = false - my_resource = self.my_resource + my_resource = my_resource recipe = converge do instance_eval("#{my_resource} 'foo'") end @@ -1412,7 +1412,7 @@ describe "Recipe DSL methods" do context "with provides? returning false to my_resource" do before do - my_resource = self.my_resource + my_resource = my_resource provider_class.define_singleton_method(:provides?) do |node, resource| @called_provides = true false @@ -1426,7 +1426,7 @@ describe "Recipe DSL methods" do it "my_resource fails to find a provider (and calls provides)" do Chef::Config[:treat_deprecation_warnings_as_errors] = false - my_resource = self.my_resource + my_resource = my_resource expect_converge do instance_eval("#{my_resource} 'foo'") end.to raise_error(Chef::Exceptions::ProviderNotFound) @@ -1437,7 +1437,7 @@ describe "Recipe DSL methods" do context "that does not provide :my_resource" do it "my_resource fails to find a provider (and calls provides)" do Chef::Config[:treat_deprecation_warnings_as_errors] = false - my_resource = self.my_resource + my_resource = my_resource expect_converge do instance_eval("#{my_resource} 'foo'") end.to raise_error(Chef::Exceptions::ProviderNotFound) |