Mercurial > repos > other > Puppet
comparison modules/stdlib/spec/functions/upcase_spec.rb @ 275:d9352a684e62
Mass update of modules to remove deprecation warnings
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 26 Jan 2020 11:36:07 +0000 |
parents | c42fb28cff86 |
children |
comparison
equal
deleted
inserted
replaced
274:b2571c28fc27 | 275:d9352a684e62 |
---|---|
1 require 'spec_helper' | 1 require 'spec_helper' |
2 | 2 |
3 describe 'upcase' do | 3 describe 'upcase', :if => Puppet::Util::Package.versioncmp(Puppet.version, '6.0.0') < 0 do |
4 describe 'signature validation' do | 4 describe 'signature validation' do |
5 it { is_expected.not_to eq(nil) } | 5 it { is_expected.not_to eq(nil) } |
6 it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) } | 6 it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) } |
7 it { is_expected.to run.with_params('', '').and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) } | 7 it { is_expected.to run.with_params('', '').and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) } |
8 it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, %r{Requires an array, hash or object that responds to upcase}) } | 8 it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, %r{Requires an array, hash or object that responds to upcase}) } |
19 it { is_expected.to run.with_params(AlsoString.new('ABC')).and_return('ABC') } | 19 it { is_expected.to run.with_params(AlsoString.new('ABC')).and_return('ABC') } |
20 end | 20 end |
21 | 21 |
22 describe 'strings in arrays handling' do | 22 describe 'strings in arrays handling' do |
23 it { is_expected.to run.with_params([]).and_return([]) } | 23 it { is_expected.to run.with_params([]).and_return([]) } |
24 it { is_expected.to run.with_params(%w[One twO]).and_return(%w[ONE TWO]) } | 24 it { is_expected.to run.with_params(['One', 'twO']).and_return(['ONE', 'TWO']) } |
25 end | 25 end |
26 end | 26 end |