Bug 173705 - Unable to use the gem test-unit 2.0.x
Unable to use the gem test-unit 2.0.x
Status: RESOLVED FIXED
Product: ruby
Classification: Unclassified
Component: Testing
6.x
All All
: P3 (vote)
: 6.x
Assigned To: Erno Mononen
issues@ruby
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-04 10:49 UTC by ehartmann
Modified: 2009-10-07 12:45 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ehartmann 2009-10-04 10:49:37 UTC
Hi,

With a rails application using the gem test-unit 2.0, Netbeans always load the test-unit from ruby installation (old one).
I'm using Ruby 1.8.7 with test-unit 2.0.3.

A quick test is to use the assert_true method which does not exist in the "old" library. While Rake succeed in testing
the application, the test fails under Netbeans with an undefined method error.

I suspect that the "error" is in ruby code (but I'm really not sure): I found a quick work-around by modifying
nb_test_mediator.rb, here is the small modification :

+
+require 'rubygems'
+begin
+  gem 'test-unit'
+  require 'test/unit/version'
+  puts "Test-unit version : #{Test::Unit::VERSION} loaded"
+rescue Gem::LoadError => e
+  puts 'Test-unit gem not found, falling back to default test-unit'
+end
 require 'test/unit'
 require 'test/unit/testcase'
 require 'test/unit/testsuite'
 require 'test/unit/ui/testrunnermediator'
 require 'getoptlong'
-require 'rubygems'
 require 'rake'
 require File.join(File.expand_path(File.dirname(__FILE__)), "nb_suite_runner")
Comment 1 Erno Mononen 2009-10-05 09:57:30 UTC
Thanks a lot for the patch, I think that is the correct fix for this. I'll give it a try and integrate to trunk then.
Comment 2 Erno Mononen 2009-10-06 09:36:56 UTC
Fixed in 794160f89154, thanks once again.
Comment 3 Quality Engineering 2009-10-07 12:45:34 UTC
Integrated into 'main-golden', will be available in build *200910070250* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/794160f89154
User: Erno Mononen <emononen@netbeans.org>
Log: #173705: Unable to use the gem test-unit 2.0.x
- special thanks to ehartmann for the patch


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo