it { is_expected.not_to eq(nil) }
describe 'signature validation in puppet3', :unless => RSpec.configuration.puppet_future do
- it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+ it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) }
it {
- pending("Current implementation ignores parameters after the third.")
- is_expected.to run.with_params(1, 2, 3, 4).and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
+ pending('Current implementation ignores parameters after the third.')
+ is_expected.to run.with_params(1, 2, 3, 4).and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i)
}
- it { is_expected.to run.with_params('1..2..3').and_raise_error(Puppet::ParseError, /Unable to compute range/i) }
- it { is_expected.to run.with_params('').and_raise_error(Puppet::ParseError, /Unknown range format/i) }
+ it { is_expected.to run.with_params('1..2..3').and_raise_error(Puppet::ParseError, %r{Unable to compute range}i) }
+ it { is_expected.to run.with_params('').and_raise_error(Puppet::ParseError, %r{Unknown range format}i) }
end
describe 'signature validation in puppet4', :if => RSpec.configuration.puppet_future do
- it { pending "the puppet 4 implementation"; is_expected.to run.with_params().and_raise_error(ArgumentError) }
- it { pending "the puppet 4 implementation"; is_expected.to run.with_params('').and_raise_error(ArgumentError) }
- it { pending "the puppet 4 implementation"; is_expected.to run.with_params({}).and_raise_error(ArgumentError) }
- it { pending "the puppet 4 implementation"; is_expected.to run.with_params([]).and_raise_error(ArgumentError) }
- it { pending "the puppet 4 implementation"; is_expected.to run.with_params(true).and_raise_error(ArgumentError) }
- it { pending "the puppet 4 implementation"; is_expected.to run.with_params(true).and_raise_error(ArgumentError) }
- it { is_expected.to run.with_params(1, 2, 'foo').and_raise_error(ArgumentError) }
- it { pending "the puppet 4 implementation"; is_expected.to run.with_params(1, 2, []).and_raise_error(ArgumentError) }
- it { pending "the puppet 4 implementation"; is_expected.to run.with_params(1, 2, {}).and_raise_error(ArgumentError) }
- it { pending "the puppet 4 implementation"; is_expected.to run.with_params(1, 2, true).and_raise_error(ArgumentError) }
- it { pending "the puppet 4 implementation"; is_expected.to run.with_params(1, 2, 3, 4).and_raise_error(ArgumentError) }
- it { pending "the puppet 4 implementation"; is_expected.to run.with_params('1..2..3').and_raise_error(ArgumentError) }
+ it {
+ pending 'the puppet 4 implementation'
+ is_expected.to run.with_params.and_raise_error(ArgumentError)
+ }
+ it {
+ pending 'the puppet 4 implementation'
+ is_expected.to run.with_params('').and_raise_error(ArgumentError)
+ }
+ it {
+ pending 'the puppet 4 implementation'
+ is_expected.to run.with_params({}).and_raise_error(ArgumentError)
+ }
+ it {
+ pending 'the puppet 4 implementation'
+ is_expected.to run.with_params([]).and_raise_error(ArgumentError)
+ }
+ it {
+ pending 'the puppet 4 implementation'
+ is_expected.to run.with_params(true).and_raise_error(ArgumentError)
+ }
+ it {
+ is_expected.to run.with_params(1, 2, 'foo').and_raise_error(ArgumentError)
+ }
+ it {
+ pending 'the puppet 4 implementation'
+ is_expected.to run.with_params(1, 2, []).and_raise_error(ArgumentError)
+ }
+ it {
+ pending 'the puppet 4 implementation'
+ is_expected.to run.with_params(1, 2, {}).and_raise_error(ArgumentError)
+ }
+ it {
+ pending 'the puppet 4 implementation'
+ is_expected.to run.with_params(1, 2, true).and_raise_error(ArgumentError)
+ }
+ it {
+ pending 'the puppet 4 implementation'
+ is_expected.to run.with_params(1, 2, 3, 4).and_raise_error(ArgumentError)
+ }
+ it {
+ pending 'the puppet 4 implementation'
+ is_expected.to run.with_params('1..2..3').and_raise_error(ArgumentError)
+ }
end
context 'with characters as bounds' do
describe 'when passing mixed arguments as bounds' do
it {
- pending('these bounds should not be allowed as ruby will OOM hard. e.g. `(\'host0\'..\'hosta\').to_a` has 3239930 elements on ruby 1.9, adding more \'0\'s and \'a\'s increases that exponentially')
- is_expected.to run.with_params('0', 'a').and_raise_error(Puppet::ParseError, /cannot interpolate between numeric and non-numeric bounds/)
+ pending('these bounds should not be allowed as ruby will OOM hard. e.g. `(\'host0\'..\'hosta\').to_a` has 3239930 elements on ruby 1.9, adding more \'0\'s and \'a\'s increases that exponentially') # rubocop:disable Metrics/LineLength : unable to cut line to required length
+ is_expected.to run.with_params('0', 'a').and_raise_error(Puppet::ParseError, %r{cannot interpolate between numeric and non-numeric bounds})
}
it {
- pending('these bounds should not be allowed as ruby will OOM hard. e.g. `(\'host0\'..\'hosta\').to_a` has 3239930 elements on ruby 1.9, adding more \'0\'s and \'a\'s increases that exponentially')
- is_expected.to run.with_params(0, 'a').and_raise_error(Puppet::ParseError, /cannot interpolate between numeric and non-numeric bounds/)
+ pending('these bounds should not be allowed as ruby will OOM hard. e.g. `(\'host0\'..\'hosta\').to_a` has 3239930 elements on ruby 1.9, adding more \'0\'s and \'a\'s increases that exponentially') # rubocop:disable Metrics/LineLength : unable to cut line to required length
+ is_expected.to run.with_params(0, 'a').and_raise_error(Puppet::ParseError, %r{cannot interpolate between numeric and non-numeric bounds})
}
it {
- pending('these bounds should not be allowed as ruby will OOM hard. e.g. `(\'host0\'..\'hosta\').to_a` has 3239930 elements on ruby 1.9, adding more \'0\'s and \'a\'s increases that exponentially')
- is_expected.to run.with_params('h0', 'ha').and_raise_error(Puppet::ParseError, /cannot interpolate between numeric and non-numeric bounds/)
+ pending('these bounds should not be allowed as ruby will OOM hard. e.g. `(\'host0\'..\'hosta\').to_a` has 3239930 elements on ruby 1.9, adding more \'0\'s and \'a\'s increases that exponentially') # rubocop:disable Metrics/LineLength : unable to cut line to required length
+ is_expected.to run.with_params('h0', 'ha').and_raise_error(Puppet::ParseError, %r{cannot interpolate between numeric and non-numeric bounds})
}
end
end