`exit?': undefined method `run?' for Test::Unit:Module (NoMethodError)?

Why am I getting this error if running from Netbeans or just from
command
line with executing blah_spec.rb? If I run with spec bla blah
blah_spec.rb
then it’s fine.

.

Finished in 0.264 seconds

1 example, 0 failures
c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.1.4/lib/spec.rb:27:in exit?': undefined methodrun?’ for Test::Unit:Module (NoMethodError)
from
c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.1.4/lib/spec/runner.rb:193:in
`register_at_exit_hook’
from C:/projects/xpstuff/watir/src/list_sitt.rb:3


View this message in context:
http://www.nabble.com/`exit-'%3A-undefined-method-`run-'-for-Test%3A%3AUnit%3AModule-(NoMethodError)--tp17685410p17685410.html
Sent from the rspec-users mailing list archive at Nabble.com.

I had the same problem with some of my specs. Solved by adding

require ‘test/unit’

to the spec file. Not complete sure why this occurs but the
Test::Unit.run? method is defined in test/unit.rb.

kasutaja wrote:

Why am I getting this error if running from Netbeans or just from
command
line with executing blah_spec.rb? If I run with spec bla blah
blah_spec.rb
then it’s fine.

.

Finished in 0.264 seconds

1 example, 0 failures
c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.1.4/lib/spec.rb:27:in exit?': undefined methodrun?’ for Test::Unit:Module (NoMethodError)
from
c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.1.4/lib/spec/runner.rb:193:in
`register_at_exit_hook’
from C:/projects/xpstuff/watir/src/list_sitt.rb:3

In that case my specs will be also run by Test::Unit and
assertions/failures/blah count will be displayed. Not exactly what I
want.

Satish G. wrote:

I had the same problem with some of my specs. Solved by adding

require ‘test/unit’

to the spec file. Not complete sure why this occurs but the
Test::Unit.run? method is defined in test/unit.rb.


View this message in context:
http://www.nabble.com/`exit-'%3A-undefined-method-`run-'-for-Test%3A%3AUnit%3AModule-(NoMethodError)--tp17685410p19366288.html
Sent from the rspec-users mailing list archive at Nabble.com.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs