empty_spec.rb 1012 B

12345678910111213141516171819202122
  1. require 'spec_helper'
  2. describe 'empty', :if => Puppet::Util::Package.versioncmp(Puppet.version, '5.5.0') < 0 do
  3. it { is_expected.not_to eq(nil) }
  4. it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError) }
  5. it {
  6. pending('Current implementation ignores parameters after the first.')
  7. is_expected.to run.with_params('one', 'two').and_raise_error(Puppet::ParseError)
  8. }
  9. it { is_expected.to run.with_params(0).and_return(false) }
  10. it { is_expected.to run.with_params('').and_return(true) }
  11. it { is_expected.to run.with_params('one').and_return(false) }
  12. it { is_expected.to run.with_params(AlsoString.new('')).and_return(true) }
  13. it { is_expected.to run.with_params(AlsoString.new('one')).and_return(false) }
  14. it { is_expected.to run.with_params([]).and_return(true) }
  15. it { is_expected.to run.with_params(['one']).and_return(false) }
  16. it { is_expected.to run.with_params({}).and_return(true) }
  17. it { is_expected.to run.with_params('key' => 'value').and_return(false) }
  18. end