rodjek/rspec-puppet — pull request #91 by agx (2013-03-29 11:15:16+00:00)
Title: Allow to set up hiera test fixtures

Currently puppet reads hiera settings from a randomly created vardir or
from puppet config. For proper test fixtrues allow it to be set either
via RSpec.configuration or via :hiera_config in specific examples e.g.:

spec/fixtures/hiera/hiera.yaml:
---
:backends:
- yaml
:hierarchy:
- test

:yaml:
:datadir: 'spec/fixtures/hiera'

spec/fixtures/hiera/test.yaml:
foovar: 'bar'

spec/spec_helper.rb:
RSpec.configure do |c|
...
c.hiera_config = File.join(fixture_path, 'hiera/hiera.yaml')
...
end

This make testing modules with hiera lookups very simple.