I am trying to reuse some code from a Rails 1.2.6 app in edge rails.
In the old app, I can run all my tests with ‘rake’ or I can run
individual tests using ‘ruby test/functionals/foo_controller_test.rb’.
But in my edge rails app, I have to use ‘rake’. If I try to run
individual tests, I get the error below. How can include my factory
module in a way that lets me run tests via rake AND individually with
gem_original_require': no such file to load -- factory (MissingSourceFile) from /usr/bin/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:inrequire’
require' from /rails/cms/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:342:innew_constants_in’
The desired Factory module is in test/factory.rb - right next to
test_helper.rb. The offending includes are:
require File.dirname(FILE) + ‘/…/test_helper’
class UserTest < Test::Unit::TestCase
ENV[“RAILS_ENV”] = “test”
require File.expand_path(File.dirname(FILE) +
And test/factory.rb starts
module Factory …