From 0702e04e0d671227259f71f614adfe3f35f88b48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Wed, 15 Jul 2009 11:33:36 +0200 Subject: Refactored some generators to make use of improved invocations on thor. --- railties/test/generators/generators_test_helper.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'railties/test') diff --git a/railties/test/generators/generators_test_helper.rb b/railties/test/generators/generators_test_helper.rb index f6799eb6da..c9b9c33a4e 100644 --- a/railties/test/generators/generators_test_helper.rb +++ b/railties/test/generators/generators_test_helper.rb @@ -12,19 +12,18 @@ $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../../activerecord/lib" $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../lib" require 'generators' +CURRENT_PATH = File.expand_path(Dir.pwd) + 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.join(self.class.test_dir, 'fixtures', 'tmp') + @destination_root ||= File.expand_path(File.join(File.dirname(__FILE__), + '..', '..', 'fixtures', 'tmp')) end def setup - cd self.class.test_dir + cd CURRENT_PATH rm_rf(destination_root) mkdir_p(destination_root) end -- cgit v1.2.3