It seems that having the test-unit gem installed causes this problem. On my Linux box, my rspec tests were all working fine for one project. I started testing another project that I had imported from a Windows development environment that referenced the test-unit gem.
Installing that gem on my Linux box gave me an error when trying to run my rspec tests. After adding config.gem "test-unit" to test.rb, the tests didn't fail but didn't run anymore. The newer application also had the same issues. I uninstalled the test-unit gem from my Linux machine and removed the config.gem requirement from both the old and new applications and everything ran fine again. I also did this on my Windows machine and everything started running as expected. Eric On Sep 10, 1:55 am, James Mead <[email protected]> wrote: > 2009/9/9 Lb2007 <[email protected]>: > > > > > After installation of Mocha (0.9.7), running "script/spec spec" > > results in a "`const_missing': uninitialized constant > > Test::Unit::TestResult::TestResultFailureSupport (NameError)" error. > > (As shown here;http://codepad.org/mTqztjwt) > > I'm running Ruby 1.8.6 with Rails 2.3.4 on Windows, rspec (-rails) > > 1.2.8 (1.2.7.1), Test::Unit 2.0.3 > > > As suggested roughly > > onhttp://stackoverflow.com/questions/1145318/getting-uninitialized-cons > > , I've added config.gem 'test-unit', :lib => 'test/unit'" to my > > environments/test.rb file at the very top. Doing so does resolve the > > trace being printed, however, no output is generated at all when > > running "script/spec spec" again. Removing the line brings back the > > trace, but logically does not resolve the issue. ( Relevant Test::Unit > > code is shown onhttp://codepad.org/bg7BlS7F) > > > What other workarounds could I give a shot? Googling doesnt seem to > > bring up alternative solutions sadly. > > I don't know anything about the RSpec side of things, but the thing > that changed in Mocha >= 0.9.6 was that previously Mocha had itself > loaded Test::Unit whereas now it expects you to load Test::Unit > yourself before you then load Mocha. > > How are you loading Mocha? If you are loading it with a config.gem > statement after the 'test-unit' one, then this should be ok and I > would guess the problem may lie in the integration with RSpec. > > Regards, James. > ----http://blog.floehopper.org/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

