[rspec-users] ordering dependency in tests?
patmaddox at me.com
Thu Feb 24 13:29:15 EST 2011
cattr_accessor, class vars / class instance vars, constants, globals...all things that maintain state across test runs, and so could lead to errors like this. I'd start looking there.
On Feb 24, 2011, at 9:55 AM, Fearless Fool wrote:
> I'm baffled. If I do:
> $ bundle exec ruby -S rspec --tty A_spec.rb
> $ bundle exec ruby -S rspec --tty B_spec.rb
> I get no errors. But then if I do:
> $ bundle exec ruby -S rspec --tty A_spec.rb B_spec.rb
> I get an error on B_spec. And if I reverse the order:
> $ bundle exec ruby -S rspec --tty B_spec.rb A_spec.rb
> I get an entirely different error on A_spec. I swear that I'm not doing
> any before(:all) anywhere, but clearly there's some state that is
> persisting between the two spec files. I've tried inserting
> $stderr.puts() messages to gain some insight as to what's happening, but
> they seem to be suppressed (is that expected?).
> So: any ideas of gotchas to look out for?
> In the meantime, I'm going to start commenting out blocks of tests in
> A_spec and see when B_spec stops failing.
> Posted via http://www.ruby-forum.com/.
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users