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.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/railties/test/generators/generators_test_helper.rb b/railties/test/generators/generators_test_helper.rb
index 2ccedf814d..f6799eb6da 100644
--- a/railties/test/generators/generators_test_helper.rb
+++ b/railties/test/generators/generators_test_helper.rb
@@ -8,17 +8,23 @@ else
RAILS_ROOT = fixtures
end
+$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../../activerecord/lib"
$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../lib"
require 'generators'
class GeneratorsTestCase < Test::Unit::TestCase
include FileUtils
+ def self.test_dir
+ @@test_dir = File.expand_path("#{File.dirname(__FILE__)}/../../")
+ end
+
def destination_root
- @destination_root ||= File.expand_path("#{File.dirname(__FILE__)}/../fixtures/tmp")
+ @destination_root ||= File.join(self.class.test_dir, 'fixtures', 'tmp')
end
def setup
+ cd self.class.test_dir
rm_rf(destination_root)
mkdir_p(destination_root)
end