2011-06-29 22:21:55 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2015-06-01 13:21:59 +02:00
|
|
|
describe 'bool2num' do
|
|
|
|
it { is_expected.not_to eq(nil) }
|
|
|
|
it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
|
2011-06-29 22:21:55 +02:00
|
|
|
|
2015-06-01 13:21:59 +02:00
|
|
|
[ true, 'true', AlsoString.new('true') ].each do |truthy|
|
|
|
|
it { is_expected.to run.with_params(truthy).and_return(1) }
|
2011-06-29 22:21:55 +02:00
|
|
|
end
|
|
|
|
|
2015-06-01 13:21:59 +02:00
|
|
|
[ false, 'false', AlsoString.new('false') ].each do |falsey|
|
|
|
|
it { is_expected.to run.with_params(falsey).and_return(0) }
|
2014-04-22 09:36:28 +02:00
|
|
|
end
|
2011-06-29 22:21:55 +02:00
|
|
|
end
|