diff options
Diffstat (limited to 'railties/test/generators/generators_test_helper.rb')
-rw-r--r-- | railties/test/generators/generators_test_helper.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/railties/test/generators/generators_test_helper.rb b/railties/test/generators/generators_test_helper.rb index ccf08c347c..829a38c103 100644 --- a/railties/test/generators/generators_test_helper.rb +++ b/railties/test/generators/generators_test_helper.rb @@ -1,5 +1,5 @@ # TODO: Fix this RAILS_ENV stuff -RAILS_ENV = 'test' +RAILS_ENV = 'test' unless defined?(RAILS_ENV) require 'abstract_unit' Rails.application.config.root = File.expand_path(File.join(File.dirname(__FILE__), '..', 'fixtures')) @@ -11,12 +11,17 @@ require 'action_dispatch' CURRENT_PATH = File.expand_path(Dir.pwd) Rails::Generators.no_color! +module Rails + def self.root + @root ||= File.expand_path(File.join(File.dirname(__FILE__), '..', 'fixtures', 'tmp')) + end +end + class GeneratorsTestCase < Test::Unit::TestCase include FileUtils def destination_root - @destination_root ||= File.expand_path(File.join(File.dirname(__FILE__), - '..', 'fixtures', 'tmp')) + Rails.root end def setup |