aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators/generators_test_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/test/generators/generators_test_helper.rb')
-rw-r--r--railties/test/generators/generators_test_helper.rb26
1 files changed, 11 insertions, 15 deletions
diff --git a/railties/test/generators/generators_test_helper.rb b/railties/test/generators/generators_test_helper.rb
index d917812383..4ce48a453b 100644
--- a/railties/test/generators/generators_test_helper.rb
+++ b/railties/test/generators/generators_test_helper.rb
@@ -1,31 +1,27 @@
-require 'test/unit'
-require 'fileutils'
-
-fixtures = File.expand_path(File.join(File.dirname(__FILE__), '..', 'fixtures'))
-if defined?(RAILS_ROOT)
- RAILS_ROOT.replace fixtures
-else
- RAILS_ROOT = fixtures
+# TODO: Fix this RAILS_ENV stuff
+RAILS_ENV = 'test' unless defined?(RAILS_ENV)
+require 'abstract_unit'
+
+module Rails
+ def self.root
+ @root ||= File.expand_path(File.join(File.dirname(__FILE__), '..', 'fixtures'))
+ end
end
+Rails.application.config.root = Rails.root
-$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../lib"
require 'rails/generators'
-
require 'rubygems'
-$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../../activerecord/lib"
-$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../../actionpack/lib"
require 'active_record'
require 'action_dispatch'
CURRENT_PATH = File.expand_path(Dir.pwd)
Rails::Generators.no_color!
-class GeneratorsTestCase < Test::Unit::TestCase
+class GeneratorsTestCase < ActiveSupport::TestCase
include FileUtils
def destination_root
- @destination_root ||= File.expand_path(File.join(File.dirname(__FILE__),
- '..', 'fixtures', 'tmp'))
+ File.join(Rails.root, "tmp")
end
def setup