views:

49

answers:

1

Hi folks,

I'm trying to run individual tests through ruby test/unit/mytest.rb, but I always get a "no such file to load - test_helper" error. Google brought up a few suggestions, but none of them worked for me. I'm running Rails 3.0, Ruby 1.9.2 (through RVM) on Ubuntu 10.10

Here's what I've tried so far - any suggestions really appreciated

  • Changed the "require test_helper" to "require File.dirname(FILE) + "/../test_helper" " in test/unit/mytest_test.rb. It brings back " no such file to load -- test/unit/../test_helper"
  • Tried running rvm test/unit/mytest_test.rb Same as above
  • Tried running ruby -I test/unit/mytest_test.rb. No messages to the terminal. After about 5 minutes waiting for something to happen, ctrl+c'd out of it

Any suggestions very appreciated - I'm stumped.

+2  A: 

ruby 1.9.2 removed ".", the current directory, from the load path. I have to do this to get it to work:

require 'test_helper'

and call it like:

ruby -I. unit/person_test.rb 
DGM
Ach! Fantastic - many thanks.
unclaimedbaggage