From f8294cb8bac6357727e7d5df5623349105c6f996 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Sat, 25 Sep 2010 13:11:07 +0200 Subject: Fix app and actions generators tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Normally Rails.application is an instance, but for those tests Rails.application needs to be class. Signed-off-by: José Valim --- railties/test/generators/app_generator_test.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'railties/test/generators/app_generator_test.rb') diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 83a6f8bc20..3653b067c8 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -42,6 +42,7 @@ class AppGeneratorTest < Rails::Generators::TestCase arguments [destination_root] def setup + Rails.application = TestApp::Application super Rails::Generators::AppGenerator.instance_variable_set('@desc', nil) @bundle_command = File.basename(Thor::Util.ruby_command).sub(/ruby/, 'bundle') @@ -56,6 +57,7 @@ class AppGeneratorTest < Rails::Generators::TestCase def teardown super Rails::Generators::AppGenerator.instance_variable_set('@desc', nil) + Rails.application = TestApp::Application.instance end def test_application_skeleton_is_created @@ -268,6 +270,7 @@ class CustomAppGeneratorTest < Rails::Generators::TestCase arguments [destination_root] def setup + Rails.application = TestApp::Application super Rails::Generators::AppGenerator.instance_variable_set('@desc', nil) @bundle_command = File.basename(Thor::Util.ruby_command).sub(/ruby/, 'bundle') @@ -277,6 +280,7 @@ class CustomAppGeneratorTest < Rails::Generators::TestCase super Rails::Generators::AppGenerator.instance_variable_set('@desc', nil) Object.class_eval { remove_const :AppBuilder if const_defined?(:AppBuilder) } + Rails.application = TestApp::Application.instance end def test_builder_option_with_empty_app_builder -- cgit v1.2.3