- it "should not compile when no arguments are passed" do
- Puppet[:code] = "validate_ipv4_address()"
- expect {
- scope.compiler.compile
- }.to raise_error(Puppet::ParseError, /wrong number of arguments/)
+ describe 'invalid inputs' do
+ [{}, [], 1, true].each do |invalid|
+ it { is_expected.to run.with_params(invalid).and_raise_error(Puppet::ParseError, %r{is not a string}) }
+ it { is_expected.to run.with_params(SharedData::IPV4_PATTERNS.first, invalid).and_raise_error(Puppet::ParseError, %r{is not a string}) }