diff options
Diffstat (limited to 'spec')
-rwxr-xr-x | spec/acceptance/empty_spec.rb | 14 | ||||
-rwxr-xr-x | spec/functions/empty_spec.rb | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/spec/acceptance/empty_spec.rb b/spec/acceptance/empty_spec.rb index 8b46aac..2d4df90 100755 --- a/spec/acceptance/empty_spec.rb +++ b/spec/acceptance/empty_spec.rb @@ -31,6 +31,20 @@ describe 'empty function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('opera expect(r.stdout).to match(/Notice: output correct/) end end + it 'handles numerical values' do + pp = <<-EOS + $a = 7 + $b = false + $o = empty($a) + if $o == $b { + notify { 'output correct': } + } + EOS + + apply_manifest(pp, :catch_failures => true) do |r| + expect(r.stdout).to match(/Notice: output correct/) + end + end end describe 'failure' do it 'handles improper argument counts' diff --git a/spec/functions/empty_spec.rb b/spec/functions/empty_spec.rb index 94b1c68..a3a25d6 100755 --- a/spec/functions/empty_spec.rb +++ b/spec/functions/empty_spec.rb @@ -3,11 +3,11 @@ require 'spec_helper' describe 'empty' do it { is_expected.not_to eq(nil) } it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) } - it { is_expected.to run.with_params(0).and_raise_error(Puppet::ParseError) } it { pending("Current implementation ignores parameters after the first.") is_expected.to run.with_params('one', 'two').and_raise_error(Puppet::ParseError) } + it { is_expected.to run.with_params(0).and_return(false) } it { is_expected.to run.with_params('').and_return(true) } it { is_expected.to run.with_params('one').and_return(false) } |