How do I get Rails to load my lib folder during tests?? Rails 2.3.8. I have this:
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require "ruby-debug"
gem 'test-unit'
require "test/unit"
require 'active_support'
require 'active_support/test_case'
require 'active_record'
require 'active_record/fixtures'
require 'shoulda'
require 'shoulda/active_record'
require 'test_help'
require 'shoulda'
ActiveSupport::Dependencies.load_paths << File.join(Rails.root, 'lib')
class ActiveSupport::TestCase
fixtures :all
end
But then if I have something like acts_as_x
in a model, and acts_as_x
is defined in Rails.root/lib/*
, and I run rake test:units
, it throws an error. Here's a test skeleton:
require 'test_helper'
class BusinessTest < ActiveSupport::TestCase
# ...
end
What am I missing here? Thanks so much.