summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Kantrowitz <noah@coderanger.net>2015-06-26 16:02:19 -0700
committerNoah Kantrowitz <noah@coderanger.net>2015-06-29 10:51:58 -0700
commite56fd56ac1bf9455b32cfe7e2a2d94d9f2a09fd0 (patch)
treea3feb91ce8c1ed2ba9264f2c8c05071d628f3a92
parent116ca7f695fd5ec20bf24cb4114e9b6984a2b5b7 (diff)
downloadchef-e56fd56ac1bf9455b32cfe7e2a2d94d9f2a09fd0.tar.gz
Make sure the default case gives an array too.
-rw-r--r--lib/chef/resource.rb2
-rw-r--r--spec/unit/resource_spec.rb4
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb
index 353eaddfa2..0679406175 100644
--- a/lib/chef/resource.rb
+++ b/lib/chef/resource.rb
@@ -1116,7 +1116,7 @@ class Chef
elsif superclass.respond_to?(:default_action)
superclass.default_action
else
- :nothing
+ [:nothing]
end
end
def self.default_action=(action_name)
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb
index 44fe1e90a3..a2bd78c783 100644
--- a/spec/unit/resource_spec.rb
+++ b/spec/unit/resource_spec.rb
@@ -987,6 +987,10 @@ describe Chef::Resource do
let(:resource) { resource_class.new('test', nil) }
subject { resource.action }
+ context "with a no action" do
+ it { is_expected.to eq [:nothing] }
+ end
+
context "with a symbol action" do
before { resource.action(:one) }
it { is_expected.to eq [:one] }