-
- context "Invalid parameters" do
- it { should run.with_params().and_raise_error(ArgumentError, /No arguments given$/) }
+ context 'with invalid parameters' do
+ it { is_expected.to run.with_params.and_raise_error(ArgumentError, %r{No arguments given}) }
+ it { is_expected.to run.with_params('puppetlabs.com', 'google.com').and_raise_error(ArgumentError, %r{Too many arguments given}) }
+ it { is_expected.to run.with_params({}).and_raise_error(TypeError, %r{no implicit conversion of Hash}) }
+ it { is_expected.to run.with_params(0).and_raise_error(TypeError, %r{no implicit conversion of Integer}) }