diff options
author | Corey Osman <corey@logicminds.biz> | 2015-09-03 10:31:51 -0700 |
---|---|---|
committer | Corey Osman <corey@logicminds.biz> | 2015-09-04 08:09:26 -0700 |
commit | f2f2db4795fc0e3b9387e1e6c003e8e75efde903 (patch) | |
tree | 683943b340206622911d3108f50b1e7f25cc4035 /spec/functions | |
parent | 6a1afae97e0451590c833acdd79fd730f49137b9 (diff) | |
download | puppet-stdlib-f2f2db4795fc0e3b9387e1e6c003e8e75efde903.tar.gz puppet-stdlib-f2f2db4795fc0e3b9387e1e6c003e8e75efde903.tar.bz2 |
accept any case of boolean strings
* previously the str2bool function did not accept 'TRUE' as a bool
type. This causes the function to now accept TRUE, FALSE strings
as a boolean type in order to be converted to a proper boolean.
* This would also cause Y,N, YES, NO to be accepted as boolean types
as well.
Diffstat (limited to 'spec/functions')
-rwxr-xr-x | spec/functions/str2bool_spec.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/functions/str2bool_spec.rb b/spec/functions/str2bool_spec.rb index 3b439b2..7d8c47c 100755 --- a/spec/functions/str2bool_spec.rb +++ b/spec/functions/str2bool_spec.rb @@ -10,13 +10,13 @@ describe 'str2bool' do it { is_expected.to run.with_params('one').and_raise_error(Puppet::ParseError, /Unknown type of boolean given/) } describe 'when testing values that mean "true"' do - [ '1', 't', 'y', 'true', 'yes', true ].each do |value| + [ 'TRUE','1', 't', 'y', 'true', 'yes', true ].each do |value| it { is_expected.to run.with_params(value).and_return(true) } end end describe 'when testing values that mean "false"' do - [ '', '0', 'f', 'n', 'false', 'no', false, 'undef', 'undefined' ].each do |value| + [ 'FALSE','', '0', 'f', 'n', 'false', 'no', false, 'undef', 'undefined' ].each do |value| it { is_expected.to run.with_params(value).and_return(false) } end end |