bool2num_spec.rb 423 B

1234567891011121314
  1. require 'spec_helper'
  2. describe 'bool2num' do
  3. it { is_expected.not_to eq(nil) }
  4. it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError) }
  5. [true, 'true', AlsoString.new('true')].each do |truthy|
  6. it { is_expected.to run.with_params(truthy).and_return(1) }
  7. end
  8. [false, 'false', AlsoString.new('false')].each do |falsey|
  9. it { is_expected.to run.with_params(falsey).and_return(0) }
  10. end
  11. end