diff --git a/spec/functions/lookup_spec.rb b/spec/functions/lookup_spec.rb index 9d3b715..0219a5c 100644 --- a/spec/functions/lookup_spec.rb +++ b/spec/functions/lookup_spec.rb @@ -58,6 +58,13 @@ }.to raise_error(Puppet::Error, %r{Unable to parse a hostname}) end + it 'returns nil instead of raising when raising is disabled' do + expect { + result = function.execute('/v1/whatever', 'vault.docker', false) + expect(result).to be(nil) + }.to_not raise_error(Puppet::Error) + end + it 'raises a Puppet error when auth fails' do connection = instance_double('Puppet::Network::HTTP::Connection', address: 'vault.doesnotexist') expect(Puppet::Network::HttpPool).to receive(:http_ssl_instance).and_return(connection)