summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Dibowitz <phil@ipom.com>2016-08-26 17:06:54 -0700
committerPhil Dibowitz <phil@ipom.com>2016-08-26 17:07:33 -0700
commitf797900d2e875dd612c6486aece5a829e4a2eb00 (patch)
treed44581feecdceebe71b19eebfbe06190a4d8cfeb
parente4e855e05dc88c4a66f04d279bafca40293fffae (diff)
downloadchef-f797900d2e875dd612c6486aece5a829e4a2eb00.tar.gz
Use bad style just for rspec
-rw-r--r--lib/chef/resource/yum_package.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/chef/resource/yum_package.rb b/lib/chef/resource/yum_package.rb
index e73c28c4cd..1647c00337 100644
--- a/lib/chef/resource/yum_package.rb
+++ b/lib/chef/resource/yum_package.rb
@@ -27,8 +27,9 @@ class Chef
# Install a specific arch
property :arch, [ String, Array ]
+ # the {} on the proc here is because rspec chokes if it's do...end
property :flush_cache, Hash, default: { before: false, after: false },
- coerce: proc do |v|
+ coerce: proc { |v|
if v.is_a?(Array)
v.each_with_object({}) { |arg, obj| obj[arg] = true }
elsif v.any?
@@ -36,7 +37,7 @@ class Chef
else
{ before: v, after: v }
end
- end
+ }
property :allow_downgrade, [ true, false ], default: false
property :yum_binary, String