rails--rails/railties/lib/rails/test_help.rb

31 lines
927 B
Ruby
Raw Normal View History

# Make double-sure the RAILS_ENV is set to test,
# so fixtures are loaded to the right database
exit("Abort testing: Your Rails environment is not running in test mode!") unless Rails.env.test?
require 'test/unit'
require 'active_support/core_ext/kernel/requires'
if defined?(ActiveRecord)
class ActiveSupport::TestCase
include ActiveRecord::TestFixtures
self.fixture_path = "#{Rails.root}/test/fixtures/"
end
2008-11-07 21:23:22 +00:00
ActionController::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path
def create_fixtures(*table_names, &block)
Fixtures.create_fixtures(ActiveSupport::TestCase.fixture_path, table_names, {}, &block)
end
end
begin
require_library_or_gem 'ruby-debug'
Debugger.start
2009-06-19 01:31:10 +00:00
if Debugger.respond_to?(:settings)
Debugger.settings[:autoeval] = true
Debugger.settings[:autolist] = 1
end
rescue LoadError
# ruby-debug wasn't available so neither can the debugging be
end