aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorStefan Sprenger <stefan.sprenger@dkd.de>2011-06-07 12:16:05 +0200
committerStefan Sprenger <stefan.sprenger@dkd.de>2011-06-07 12:16:05 +0200
commit246c36757065aa74a88b67db4c70e9e5cf3bd8b3 (patch)
treecff691aa78be8e66acf51977a96d967223df7a0d /railties/test
parent8ea90ffdb8a08438e72054518f8f0b54c628b3ea (diff)
downloadrails-246c36757065aa74a88b67db4c70e9e5cf3bd8b3.tar.gz
rails-246c36757065aa74a88b67db4c70e9e5cf3bd8b3.tar.bz2
rails-246c36757065aa74a88b67db4c70e9e5cf3bd8b3.zip
Use RAILS_ISOLATED_ENGINE and fix namespaced generators tests
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/abstract_unit.rb1
-rw-r--r--railties/test/generators/namespaced_generators_test.rb10
-rw-r--r--railties/test/isolation/abstract_unit.rb2
-rw-r--r--railties/test/railties/generators_test.rb2
4 files changed, 3 insertions, 12 deletions
diff --git a/railties/test/abstract_unit.rb b/railties/test/abstract_unit.rb
index 8b38081667..1c3f8a701a 100644
--- a/railties/test/abstract_unit.rb
+++ b/railties/test/abstract_unit.rb
@@ -10,7 +10,6 @@ require 'active_support/core_ext/logger'
require 'action_controller'
require 'rails/all'
-# TODO: Remove these hacks
module TestApp
class Application < Rails::Application
config.root = File.dirname(__FILE__)
diff --git a/railties/test/generators/namespaced_generators_test.rb b/railties/test/generators/namespaced_generators_test.rb
index 17cbac0912..dd1e4bdac1 100644
--- a/railties/test/generators/namespaced_generators_test.rb
+++ b/railties/test/generators/namespaced_generators_test.rb
@@ -7,15 +7,7 @@ require 'rails/generators/rails/scaffold/scaffold_generator'
class NamespacedGeneratorTestCase < Rails::Generators::TestCase
def setup
- TestApp::Application.isolate_namespace(TestApp)
- end
-
- def teardown
- if TestApp.respond_to?(:_railtie)
- TestApp.singleton_class.send(:undef_method, :_railtie)
- TestApp.singleton_class.send(:undef_method, :table_name_prefix)
- TestApp::Application.isolated = false
- end
+ Rails::Generators.namespace = TestApp
end
end
diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb
index a13da12ae1..53d3f288d9 100644
--- a/railties/test/isolation/abstract_unit.rb
+++ b/railties/test/isolation/abstract_unit.rb
@@ -280,4 +280,4 @@ Module.new do
end
f.puts "require 'rails/all'"
end
-end unless RAILS_ISOLATION_COMMAND=="engine"
+end unless defined?(RAILS_ISOLATED_ENGINE)
diff --git a/railties/test/railties/generators_test.rb b/railties/test/railties/generators_test.rb
index 963518880d..fe59dcd52b 100644
--- a/railties/test/railties/generators_test.rb
+++ b/railties/test/railties/generators_test.rb
@@ -1,4 +1,4 @@
-RAILS_ISOLATION_COMMAND = "engine"
+RAILS_ISOLATED_ENGINE = true
require "isolation/abstract_unit"
require "#{RAILS_FRAMEWORK_ROOT}/railties/lib/rails/generators/test_case"