Что не так с тестовой структурой? Я просто пишу тестовые коды для моделей.
Они работают нормально, когда я запускаю каждый отдельный тест отдельно
cd test
ruby ./unit/model_name_test.rb
Но теперь я хочу запустить все тесты за один раз, используя задачу rake test вроде
$ bundle exec rake test -t
Я получил сообщение об ошибке ActiveSupport не инициализируется .. Пожалуйста, смотрите подробную информацию ниже.
ВЕРСИЯ ЖЕЛЕЗНОДОРОЖНЫХ: 3.0.7
ГРАФИЧЕСКАЯ ВЕРСИЯ: 0.8.7
(in /Users/lewisou/Workspaces/scs)
** Invoke test (first_time)
** Execute test
** Invoke test:units (first_time)
** Invoke test:prepare (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:abort_if_pending_migrations
** Execute db:test:prepare
** Invoke db:test:load (first_time)
** Invoke db:test:purge (first_time)
** Invoke environment
** Execute db:test:purge
** Execute db:test:load
** Invoke db:schema:load (first_time)
** Invoke environment
** Execute db:schema:load
** Execute test:prepare
** Execute test:units
./test/unit/assign_test.rb:3: uninitialized constant ActiveSupport (NameError)
from /Users/lewisou/.rvm/gems/ree-1.8.7-2011.03@scs/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `load'
from /Users/lewisou/.rvm/gems/ree-1.8.7-2011.03@scs/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5
from /Users/lewisou/.rvm/gems/ree-1.8.7-2011.03@scs/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `each'
from /Users/lewisou/.rvm/gems/ree-1.8.7-2011.03@scs/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5
** Invoke test:functionals (first_time)
** Invoke test:prepare
** Execute test:functionals
** Invoke test:integration (first_time)
** Invoke test:prepare
** Execute test:integration
Errors running test:units!
Вот мой test_helper.rb
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require 'ext/ruby-ole'
require "#{Rails.root}/db/seeds.rb"
class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
#
# Note: You'll currently still have to declare fixtures explicitly in integration tests
# -- they do not yet inherit this setting
# fixtures :all
# Add more helper methods to be used by all tests here...
end