diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2015-02-19 16:08:13 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2015-02-23 10:14:04 -0800 |
commit | 5197f612b78cc1e109b58c9bef206c7a79b7fbca (patch) | |
tree | 833faf958c416564cce18cc522139c5ecd4c68c8 | |
parent | 687a6a2c0caece10407a36bcfabbf53b181e3149 (diff) | |
download | chef-5197f612b78cc1e109b58c9bef206c7a79b7fbca.tar.gz |
add explicit test for nillable_set_or_return
-rw-r--r-- | spec/unit/mixin/params_validate_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/unit/mixin/params_validate_spec.rb b/spec/unit/mixin/params_validate_spec.rb index 59e5aa6416..1b61f9b238 100644 --- a/spec/unit/mixin/params_validate_spec.rb +++ b/spec/unit/mixin/params_validate_spec.rb @@ -411,4 +411,11 @@ describe Chef::Mixin::ParamsValidate do test_set_or_return_method(:set_or_return) test_set_or_return_method(:nillable_set_or_return) + + it "nillable_set_or_return supports nilling values" do + expect(@vo.nillable_set_or_return(:test, "meow", {})).to eq("meow") + expect(@vo.nillable_set_or_return(:test, TinyClass::NULL_ARG, {})).to eq("meow") + expect(@vo.nillable_set_or_return(:test, nil, {})).to be_nil + expect(@vo.nillable_set_or_return(:test, TinyClass::NULL_ARG, {})).to be_nil + end end |