amfranz / rspec-hiera-puppet

Hiera fixtures for puppet-rspec tests.
MIT License
14 stars 32 forks source link

Hiera resolution issue #3

Closed haf closed 10 years ago

haf commented 12 years ago

I'm trying to unit-test using this gem...

Have a look at this

https://github.com/haf/puppet-riak/blob/9f7c95cdc46019af9503717b07a928e63d9d9857/spec/classes/vmargs_spec.rb#L26

This is the order in which I expect hiera to choose values:

  1. From riak::vmargs class spec's :params
  2. From riak::vmargs class spec's :hiera_data
  3. From shared_context 'hieradata''s :hiera_data
  4. From riak::params
  5. From riak::vmargs( $absent = hiera('absent', 'false') ) - the default just by the class parameter

But it seems that the default value from the hiera function overrides everything from within the rspec's hiera_data.

Perhaps @haus could have a look at this as well?

I might be doing something wrong...

To try it:

bundle
bundle exec rake specs
haf commented 10 years ago

Great comback there.