Bret Pettichord
2008-Nov-15 00:13 UTC
[rspec-users] undefined method `run?'' for Test::Unit:Module
Hello. I just ran into an error I wanted to share. The error message is below. I tracked down the error to the following conditions: 1. I am using the new version of Watir (1.6.2) 2. This version of Watir uses the "user-choices" gem (from Marick) 3. This gem does not load Test::Unit, but does define a Test constant (not sure why, but Marick likes testing) 4. Rspec thinks that Test::Unit has been loaded (even though it hasn''t) because the Test constant is defined. As a result, my rspec script gives me this error. Any suggestions? Increase the guard on the failing method call? Bret ..C:/ruby-186-26/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec.rb:25:in `exit?'' Finished in 18.625 seconds 2 examples, 0 failures : undefined method `run?'' for Test::Unit:Module (NoMethodError) from C:/ruby-186-26/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/runner.rb:192:in `register_at_exit_hook'' from samples/lab6-refactored.rb:4 -- Bret Pettichord GTalk: bpettichord at gmail.com CTO, WatirCraft LLC, http://www.watircraft.com Lead Developer, Watir, http://wtr.rubyforge.org Blog (Essays), http://www.io.com/~wazmo/blog MiniBlog (Links), http://feeds.feedburner.com/bretshotlist -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081114/07198db4/attachment.html>
Brian Takita
2008-Nov-15 22:44 UTC
[rspec-users] undefined method `run?'' for Test::Unit:Module
On Fri, Nov 14, 2008 at 7:13 PM, Bret Pettichord <bret at pettichord.com> wrote:> Hello. I just ran into an error I wanted to share. > > The error message is below. I tracked down the error to the following > conditions: > 1. I am using the new version of Watir (1.6.2) > 2. This version of Watir uses the "user-choices" gem (from Marick) > 3. This gem does not load Test::Unit, but does define a Test constant (not > sure why, but Marick likes testing) > 4. Rspec thinks that Test::Unit has been loaded (even though it hasn''t) > because the Test constant is defined. > > As a result, my rspec script gives me this error. Any suggestions? Increase > the guard on the failing method call?Bret, try requiring test/unit before requiring rspec. I think this has to do with Rails trying to reopen a test/unit module that doesn''t exists (since test/unit was not required), so it defines the Test module instead.> > Bret > > ..C:/ruby-186-26/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec.rb:25:in > `exit?'' > > Finished in 18.625 seconds > > 2 examples, 0 failures > : undefined method `run?'' for Test::Unit:Module (NoMethodError) > from > C:/ruby-186-26/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/runner.rb:192:in > `register_at_exit_hook'' > from samples/lab6-refactored.rb:4 > > -- > Bret Pettichord > GTalk: bpettichord at gmail.com > CTO, WatirCraft LLC, http://www.watircraft.com > Lead Developer, Watir, http://wtr.rubyforge.org > Blog (Essays), http://www.io.com/~wazmo/blog > MiniBlog (Links), http://feeds.feedburner.com/bretshotlist > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Scott Taylor
2008-Nov-16 04:54 UTC
[rspec-users] undefined method `run?'' for Test::Unit:Module
On Nov 14, 2008, at 7:13 PM, Bret Pettichord wrote:> Hello. I just ran into an error I wanted to share. > > The error message is below. I tracked down the error to the > following conditions: > 1. I am using the new version of Watir (1.6.2) > 2. This version of Watir uses the "user-choices" gem (from Marick) > 3. This gem does not load Test::Unit, but does define a Test > constant (not sure why, but Marick likes testing) > 4. Rspec thinks that Test::Unit has been loaded (even though it > hasn''t) because the Test constant is defined. > > As a result, my rspec script gives me this error. Any suggestions? > Increase the guard on the failing method call? > > Bret > > ..C:/ruby-186-26/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec.rb: > 25:in `exit?'' > > Finished in 18.625 seconds > > 2 examples, 0 failures > : undefined method `run?'' for Test::Unit:Module (NoMethodError) > from C:/ruby-186-26/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/ > runner.rb:192:in `register_at_exit_hook'' > from samples/lab6-refactored.rb:4File it on lighthouse. I cued David into this bug @ rubyconf, and he seemed somewhat surprised by it. No doubt, it has something to do with active_record/active_support requiring test/unit. Scott
David Chelimsky
2008-Nov-17 00:15 UTC
[rspec-users] undefined method `run?'' for Test::Unit:Module
On Sat, Nov 15, 2008 at 10:54 PM, Scott Taylor <mailing_lists at railsnewbie.com> wrote:> > On Nov 14, 2008, at 7:13 PM, Bret Pettichord wrote: > >> Hello. I just ran into an error I wanted to share. >> >> The error message is below. I tracked down the error to the following >> conditions: >> 1. I am using the new version of Watir (1.6.2) >> 2. This version of Watir uses the "user-choices" gem (from Marick) >> 3. This gem does not load Test::Unit, but does define a Test constant (not >> sure why, but Marick likes testing) >> 4. Rspec thinks that Test::Unit has been loaded (even though it hasn''t) >> because the Test constant is defined. >> >> As a result, my rspec script gives me this error. Any suggestions? >> Increase the guard on the failing method call? >> >> Bret >> >> ..C:/ruby-186-26/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec.rb:25:in >> `exit?'' >> >> Finished in 18.625 seconds >> >> 2 examples, 0 failures >> : undefined method `run?'' for Test::Unit:Module (NoMethodError) >> from >> C:/ruby-186-26/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/runner.rb:192:in >> `register_at_exit_hook'' >> from samples/lab6-refactored.rb:4 > > > File it on lighthouse. I cued David into this bug @ rubyconf, and he seemed > somewhat surprised by it. No doubt, it has something to do with > active_record/active_support requiring test/unit.Fixed: http://github.com/dchelimsky/rspec/commit/5b163e285d2e774ac474d3ffad5676bf273820f9 Cheers, David> > Scott > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >