From 6c4c1d6a5c9eda3dc40b38a17d366a3bcac52582 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Thu, 11 Oct 2018 19:37:57 -0700 Subject: Update per lamonts comment Signed-off-by: Tim Smith --- lib/chef/mixin/params_validate.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/chef/mixin/params_validate.rb b/lib/chef/mixin/params_validate.rb index 8a5f27c8fa..841a5a8fe6 100644 --- a/lib/chef/mixin/params_validate.rb +++ b/lib/chef/mixin/params_validate.rb @@ -175,8 +175,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 -- cgit v1.2.1