Hi,

I have an issue with rSpec when spec'ing a module. The module in
question looks like this:

module Sheep
  def self.sound
    @sound ||= produce_sound()
  end
end

This module is used all around the application (and corresponding
specs) and somehow values of @sound leak between each spec. The only
way I found to fix it is to manually set the instance variable (with
instance_variable_set) to nil. Obviously this is Bad. Is there a way
to do this globally or better yet to prevent this?

With kind regards,
Harm

_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to