[rspec-devel] [ rspec-Bugs-7805 ] Stubs aren't being removed from modules

noreply at rubyforge.org noreply at rubyforge.org
Sat Jan 13 20:59:06 EST 2007


Bugs item #7805, was opened at 2007-01-14 01:59
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=7805&group_id=797

Category: mock module
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Michal Kwiatkowski (infrared)
Assigned to: Nobody (None)
Summary: Stubs aren't being removed from modules

Initial Comment:
Stubs aren't removed after running specs, which doesn't break things for modules begin tested, but can be source of bugs if you're stubbing classes from stdlib. Example code stubs File.open and manages to break RSpec code itself. Place attached Rakefile and spec in the same directory, then run "rake --trace" to see:

undefined method `<' for nil:NilClass
/usr/lib/ruby/gems/1.8/gems/rspec-0.7.5/lib/spec/rake/verify_rcov.rb:42:in `define'

Source of this error is 'total_coverage' variable which doesn't get initialized because File.open doesn't yield nor return anything useful (because it's still stubbed).

As you see in the stack report, I'm using rspec 0.7.5.

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=7805&group_id=797


More information about the rspec-devel mailing list