diff options
Diffstat (limited to 'spec/unit/mixin/params_validate_spec.rb')
-rw-r--r-- | spec/unit/mixin/params_validate_spec.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/unit/mixin/params_validate_spec.rb b/spec/unit/mixin/params_validate_spec.rb index 1cc7fef58e..29d69af403 100644 --- a/spec/unit/mixin/params_validate_spec.rb +++ b/spec/unit/mixin/params_validate_spec.rb @@ -236,7 +236,7 @@ describe Chef::Mixin::ParamsValidate do { one: { kind_of: String, - respond_to: [ :to_s, :upcase ], + respond_to: %i{to_s upcase}, regex: /^is good/, callbacks: { "should be your friend" => lambda do |a| @@ -260,7 +260,7 @@ describe Chef::Mixin::ParamsValidate do { one: { kind_of: String, - respond_to: [ :to_s, :upcase ], + respond_to: %i{to_s upcase}, regex: /^is good/, callbacks: { "should be your friend" => lambda do |a| @@ -334,22 +334,22 @@ describe Chef::Mixin::ParamsValidate do it "asserts that a value returns false from a predicate method" do expect do @vo.validate({ not_blank: "should pass" }, - { not_blank: { cannot_be: [ :nil, :empty ] } }) + { not_blank: { cannot_be: %i{nil empty} } }) end.not_to raise_error expect do @vo.validate({ not_blank: "" }, - { not_blank: { cannot_be: [ :nil, :empty ] } }) + { not_blank: { cannot_be: %i{nil empty} } }) end.to raise_error(Chef::Exceptions::ValidationFailed) end it "allows a custom validation message" do expect do @vo.validate({ not_blank: "should pass" }, - { not_blank: { cannot_be: [ :nil, :empty ], validation_message: "my validation message" } }) + { not_blank: { cannot_be: %i{nil empty}, validation_message: "my validation message" } }) end.not_to raise_error expect do @vo.validate({ not_blank: "" }, - { not_blank: { cannot_be: [ :nil, :empty ], validation_message: "my validation message" } }) + { not_blank: { cannot_be: %i{nil empty}, validation_message: "my validation message" } }) end.to raise_error(Chef::Exceptions::ValidationFailed, "my validation message") end |