summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chef/mixin/params_validate.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/mixin/params_validate.rb b/lib/chef/mixin/params_validate.rb
index b7597d2dee..c5ca1f85b8 100644
--- a/lib/chef/mixin/params_validate.rb
+++ b/lib/chef/mixin/params_validate.rb
@@ -179,8 +179,8 @@ class Chef
return true if value == tb
end
# Ruby will print :something as something, which confuses users so make sure to print them as symbols
- corrected_type_array = to_be.collect { |x| x.kind_of?(Symbol) ? ":#{x}" : x }
- raise Exceptions::ValidationFailed, _validation_message(key, "Option #{key} must be equal to one of: #{corrected_type_array.join(", ")}! You passed #{value.inspect}.")
+ # by inspecting the value instead of just printing it
+ raise Exceptions::ValidationFailed, _validation_message(key, "Option #{key} must be equal to one of: #{to_be.map { |v| v.inspect }.join(", ")}! You passed #{value.inspect}.")
end
end