1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
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 16:23:22 -05: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-18 21:31:10 -04: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