2006-11-27 05:19:15 +00:00
|
|
|
# Make double-sure the RAILS_ENV is set to test,
|
2005-11-09 15:11:55 +00:00
|
|
|
# so fixtures are loaded to the right database
|
|
|
|
silence_warnings { RAILS_ENV = "test" }
|
|
|
|
|
2008-11-17 23:18:01 +00:00
|
|
|
require 'test/unit'
|
2009-06-30 16:05:53 +00:00
|
|
|
require 'active_support/core_ext/kernel/requires'
|
2009-12-03 04:01:01 +00:00
|
|
|
|
2008-11-12 19:33:09 +00:00
|
|
|
if defined?(ActiveRecord)
|
|
|
|
class ActiveSupport::TestCase
|
|
|
|
include ActiveRecord::TestFixtures
|
2009-10-16 19:49:39 +00:00
|
|
|
self.fixture_path = "#{Rails.root}/test/fixtures/"
|
2008-11-12 19:33:09 +00:00
|
|
|
end
|
2008-11-07 21:23:22 +00:00
|
|
|
|
2008-11-12 19:33:09 +00:00
|
|
|
ActionController::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path
|
2005-10-15 03:02:28 +00:00
|
|
|
|
2008-11-12 19:33:09 +00:00
|
|
|
def create_fixtures(*table_names, &block)
|
|
|
|
Fixtures.create_fixtures(ActiveSupport::TestCase.fixture_path, table_names, {}, &block)
|
|
|
|
end
|
2005-10-15 17:05:55 +00:00
|
|
|
end
|
2008-01-09 18:50:06 +00:00
|
|
|
|
|
|
|
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
|
2008-01-09 18:50:06 +00:00
|
|
|
rescue LoadError
|
|
|
|
# ruby-debug wasn't available so neither can the debugging be
|
2008-06-13 01:19:34 +00:00
|
|
|
end
|