Open rnelson0 opened 8 years ago
I'm seeing the same failure for the hiera_hash('key', {}) flavor
The underlying hiera-puppet-helper library has the problem. Made up a PR to resolve the behavior: https://github.com/mthibaut/hiera-puppet-helper/pull/6
@rnelson0 are you seeing this when using hiera-puppet-helper or when using Puppet's hiera function?
I'm not using hiera-puppet-helper, just puppetlabs_spec_helper and this in my spec/spec_helper.rb
:
RSpec.configure do |c|
c.hiera_config = File.expand_path(File.join(__FILE__, '../fixtures/hiera.yaml'))
end
I have the following code in a manifest:
This generates an error like this:
However,
puppet apply
doesn't mind it at all. I believe rspec-puppet is not calling or mocking up hiera properly. Hiera lookups for values that do exist, do function as expected.