diff options
author | John Keiser <john@johnkeiser.com> | 2015-05-27 16:06:53 -0700 |
---|---|---|
committer | John Keiser <john@johnkeiser.com> | 2015-06-01 13:21:21 -0700 |
commit | 236570dc9605ac312b44508b1c3a6a0e7c19b4dc (patch) | |
tree | 966a79db0d03021e2ed0e5a9ba2bf5073fff153c /spec/unit | |
parent | 02e8874637dd661b5aaf656a5c2d6fbbb5795619 (diff) | |
download | chef-236570dc9605ac312b44508b1c3a6a0e7c19b4dc.tar.gz |
Add default_action and allowed_actions to Resource class, remove from LWRP
Diffstat (limited to 'spec/unit')
-rw-r--r-- | spec/unit/lwrp_spec.rb | 8 | ||||
-rw-r--r-- | spec/unit/provider/deploy_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/recipe_spec.rb | 4 | ||||
-rw-r--r-- | spec/unit/resource/breakpoint_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/resource/erl_call_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/resource/file_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/resource/route_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/resource/ruby_block_spec.rb | 4 | ||||
-rw-r--r-- | spec/unit/resource/windows_service_spec.rb | 2 |
9 files changed, 14 insertions, 14 deletions
diff --git a/spec/unit/lwrp_spec.rb b/spec/unit/lwrp_spec.rb index 8cac70e800..f83678308a 100644 --- a/spec/unit/lwrp_spec.rb +++ b/spec/unit/lwrp_spec.rb @@ -146,7 +146,7 @@ describe "LWRP" do it "Should load the old content, and not the new" do resource = Chef::Resource.resource_for_node(:lwrp_foo, Chef::Node.new) expect(resource).to eq @original_resource - expect(resource.default_action).to eq([:pass_buck]) + expect(resource.default_action).to eq(:pass_buck) expect(Chef.method_defined?(:method_created_by_override_lwrp_foo)).to be_falsey end end @@ -185,7 +185,7 @@ describe "LWRP" do end it "should set the specified action as the default action" do - expect(get_lwrp(:lwrp_foo).new("blah").action).to eq([:pass_buck]) + expect(get_lwrp(:lwrp_foo).new("blah").action).to eq(:pass_buck) end it "should create a method for each attribute" do @@ -281,7 +281,7 @@ describe "LWRP" do end it "delegates #default_action to the parent" do - expect(child.default_action).to eq([:eat]) + expect(child.default_action).to eq(:eat) end end @@ -298,7 +298,7 @@ describe "LWRP" do end it "does not delegate #default_action to the parent" do - expect(child.default_action).to eq([:dont_eat]) + expect(child.default_action).to eq(:dont_eat) end end diff --git a/spec/unit/provider/deploy_spec.rb b/spec/unit/provider/deploy_spec.rb index a2997d8399..63658ac601 100644 --- a/spec/unit/provider/deploy_spec.rb +++ b/spec/unit/provider/deploy_spec.rb @@ -622,7 +622,7 @@ describe Chef::Provider::Deploy do gems = @provider.send(:gem_packages) - expect(gems.map { |g| g.action }).to eq([[:install]]) + expect(gems.map { |g| g.action }).to eq([:install]) expect(gems.map { |g| g.name }).to eq(%w{eventmachine}) expect(gems.map { |g| g.version }).to eq(%w{0.12.9}) end diff --git a/spec/unit/recipe_spec.rb b/spec/unit/recipe_spec.rb index 59d05298c3..86f9a2d1d7 100644 --- a/spec/unit/recipe_spec.rb +++ b/spec/unit/recipe_spec.rb @@ -412,7 +412,7 @@ describe Chef::Recipe do end it "does not copy the action from the first resource" do - expect(original_resource.action).to eq([:score]) + expect(original_resource.action).to eq(:score) expect(duplicated_resource.action).to eq(:nothing) end @@ -508,7 +508,7 @@ describe Chef::Recipe do recipe.from_file(File.join(CHEF_SPEC_DATA, "recipes", "test.rb")) res = recipe.resources(:file => "/etc/nsswitch.conf") expect(res.name).to eql("/etc/nsswitch.conf") - expect(res.action).to eql([:create]) + expect(res.action).to eql(:create) expect(res.owner).to eql("root") expect(res.group).to eql("root") expect(res.mode).to eql(0644) diff --git a/spec/unit/resource/breakpoint_spec.rb b/spec/unit/resource/breakpoint_spec.rb index ed1f3ebcd5..9c867ebcc7 100644 --- a/spec/unit/resource/breakpoint_spec.rb +++ b/spec/unit/resource/breakpoint_spec.rb @@ -37,7 +37,7 @@ describe Chef::Resource::Breakpoint do end it "defaults to the break action" do - expect(@breakpoint.action).to eq("break") + expect(@breakpoint.action).to eq(:break) end it "names itself after the line number of the file where it's created" do diff --git a/spec/unit/resource/erl_call_spec.rb b/spec/unit/resource/erl_call_spec.rb index 8ec182665f..008d27372a 100644 --- a/spec/unit/resource/erl_call_spec.rb +++ b/spec/unit/resource/erl_call_spec.rb @@ -35,7 +35,7 @@ describe Chef::Resource::ErlCall do end it "should have a default action of run" do - expect(@resource.action).to eql("run") + expect(@resource.action).to eql(:run) end it "should accept run as an action" do diff --git a/spec/unit/resource/file_spec.rb b/spec/unit/resource/file_spec.rb index db52e35004..dd20f5f03a 100644 --- a/spec/unit/resource/file_spec.rb +++ b/spec/unit/resource/file_spec.rb @@ -29,7 +29,7 @@ describe Chef::Resource::File do end it "should have a default action of 'create'" do - expect(@resource.action).to eql("create") + expect(@resource.action).to eql(:create) end it "should have a default content of nil" do diff --git a/spec/unit/resource/route_spec.rb b/spec/unit/resource/route_spec.rb index ec1d369932..ffb9304511 100644 --- a/spec/unit/resource/route_spec.rb +++ b/spec/unit/resource/route_spec.rb @@ -35,7 +35,7 @@ describe Chef::Resource::Route do end it "should have a default action of 'add'" do - expect(@resource.action).to eql([:add]) + expect(@resource.action).to eql(:add) end it "should accept add or delete for action" do diff --git a/spec/unit/resource/ruby_block_spec.rb b/spec/unit/resource/ruby_block_spec.rb index 9f19fecd4f..5d83f7e367 100644 --- a/spec/unit/resource/ruby_block_spec.rb +++ b/spec/unit/resource/ruby_block_spec.rb @@ -31,7 +31,7 @@ describe Chef::Resource::RubyBlock do end it "should have a default action of 'create'" do - expect(@resource.action).to eql("run") + expect(@resource.action).to eql(:run) end it "should have a resource name of :ruby_block" do @@ -46,7 +46,7 @@ describe Chef::Resource::RubyBlock do it "allows the action to be 'create'" do @resource.action :create - expect(@resource.action).to eq([:create]) + expect(@resource.action).to eq(:create) end describe "when it has been initialized with block code" do diff --git a/spec/unit/resource/windows_service_spec.rb b/spec/unit/resource/windows_service_spec.rb index 45a295c24e..8866cad1bf 100644 --- a/spec/unit/resource/windows_service_spec.rb +++ b/spec/unit/resource/windows_service_spec.rb @@ -44,6 +44,6 @@ describe Chef::Resource::WindowsService, "initialize" do it "allows the action to be 'configure_startup'" do resource.action :configure_startup - expect(resource.action).to eq([:configure_startup]) + expect(resource.action).to eq(:configure_startup) end end |