Lets say I have the following tests:
context 'test' do
let(:hiera_data) { { :number => '2' } }
it { should have_module__define_resource_count(2) }
end
context 'test2' do
let(:hiera_data) { { :number => '10' } }
it { should have_module__define_resource_count(10) }
end
The first test passes, but when the second test is ran it fails, because the hiera variable number
is still 2.
It seems that let(:hiera_data)
is unable to override the previous declared variable.
According to this readme it should work if the hiera data is set in different files, but it does not work.
How do I test hiera multiple times in one specfile?