summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-10-10 15:24:06 -0700
committerTim Smith <tsmith@chef.io>2018-10-11 14:38:55 -0700
commitc29d12950e556f8e99efc03542d245606d5e7e1c (patch)
tree2aec27c47a86237e5de4f0599598a9fdd245661b
parent0c8f73047924ef49dc7b7bccdfb3325b15219d19 (diff)
downloadchef-better_regex_error.tar.gz
When a property regex fails don't call it an optionbetter_regex_error
These aren't options. These are properties. Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/mixin/params_validate.rb2
-rw-r--r--spec/unit/environment_spec.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/mixin/params_validate.rb b/lib/chef/mixin/params_validate.rb
index f77adecd60..49e6914245 100644
--- a/lib/chef/mixin/params_validate.rb
+++ b/lib/chef/mixin/params_validate.rb
@@ -300,7 +300,7 @@ class Chef
Array(regex).flatten.each do |r|
return true if r.match(value.to_s)
end
- raise Exceptions::ValidationFailed, _validation_message(key, "Option #{key}'s value #{value} does not match regular expression #{regex.inspect}")
+ raise Exceptions::ValidationFailed, _validation_message(key, "Property #{key}'s value #{value} does not match regular expression #{regex.inspect}")
end
end
diff --git a/spec/unit/environment_spec.rb b/spec/unit/environment_spec.rb
index a342d6d7cd..483ee615a2 100644
--- a/spec/unit/environment_spec.rb
+++ b/spec/unit/environment_spec.rb
@@ -317,7 +317,7 @@ describe Chef::Environment do
it "validates the name given in the params" do
expect(@environment.update_from_params(name: "@$%^&*()")).to be_falsey
- expect(@environment.invalid_fields[:name]).to eq(%q{Option name's value @$%^&*() does not match regular expression /^[\-[:alnum:]_]+$/})
+ expect(@environment.invalid_fields[:name]).to eq(%q{Property name's value @$%^&*() does not match regular expression /^[\-[:alnum:]_]+$/})
end
it "updates the description from parameters[:description]" do