amfranz / rspec-hiera-puppet

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

Doesn't work properly with contexts #9

Closed liamjbennett closed 10 years ago

liamjbennett commented 11 years ago

With the following example rspec:

context "test" do
  let :hiera_data do
    { :test => "fu" }
  end
  it { should contain_notify("foo").with_message("fu") }
end

context "test-2" do
    let :hiera_data do
    { :test => "bar" }
  end
  it { should contain_notify("foo").with_message("bar") }
end

The first and second will pass if run individually but when run one after the other it appears that hiera_data in the second context (:test => "bar") is not set and that the first one is still used (:test => "fu").

liamjbennett commented 11 years ago

@mthibaut @jlambert121 - any ideas if hiera-puppet-helper fixes this issue? I don't think it does either.

justinclayton commented 11 years ago

It appears to be broken in hiera-puppet-helper as well.

mthibaut commented 11 years ago

That is correct. Suggested workaround is to split up the tests in multiple files.

bodepd commented 11 years ago

I just ran into this as well. I'm going to have a peek in the code and see if it looks reasonable to patch.

flypenguin commented 10 years ago

Any updates here? I just ran into this and think this is a really annoying bug.

flypenguin commented 10 years ago

does that mean it's fixed now? a comment here would have been nice, really.

amfranz commented 10 years ago

No, the issue is not fixed, or at least not fixed in this fork of the repository.

I haven't supported this project for quite a while, and it has stopped working entirely for more recent Puppet versions. In the meantime others have picked up my work and improved upon it, for example:

I came to the realization that I do not have the time or motivation to pick up support for this project again, therefore I thought it prudent to officially retire this project and suggest everyone to use one of the better maintained forks. I have left a note indicating this on the projects front page. As part of retiring the project I also closed out all the open issues, to not give anyone false hope that the issues might still get addressed at some point in the future.

Last but not least, I apologize. You are right, I should have left a comment before closing the issues, in hindsight I realize that was inconsiderate of me.