From 2b355757d5485beb42a4184e28621d86daced862 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Sat, 10 Mar 2012 17:51:31 -0300 Subject: Remove duplicated tests from shared generator [Carlos Antonio da Silva & Santiago Pastorino] --- railties/test/generators/app_generator_test.rb | 3 ++- railties/test/generators/shared_generator_tests.rb | 15 --------------- 2 files changed, 2 insertions(+), 16 deletions(-) (limited to 'railties') diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index c949d9a3b0..45f991f681 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -369,7 +369,8 @@ class AppGeneratorTest < Rails::Generators::TestCase def test_http_only_generates_application_controller_with_action_controller_http run_generator [destination_root, "--http-only"] - assert_file "app/controllers/application_controller.rb", /class ApplicationController < ActionController::HTTP/ + assert_file "app/controllers/application_controller.rb", + /class ApplicationController < ActionController::HTTP/ end def test_http_only_generates_application_controller_with_protect_from_forgery_commented_out_setup diff --git a/railties/test/generators/shared_generator_tests.rb b/railties/test/generators/shared_generator_tests.rb index 14a20eddb8..92117855b7 100644 --- a/railties/test/generators/shared_generator_tests.rb +++ b/railties/test/generators/shared_generator_tests.rb @@ -91,21 +91,6 @@ module SharedGeneratorTests assert_match(/It works!/, capture(:stdout) { generator.invoke_all }) end - def test_template_raises_an_error_with_invalid_path - content = capture(:stderr){ run_generator([destination_root, "-m", "non/existant/path"]) } - assert_match(/The template \[.*\] could not be loaded/, content) - assert_match(/non\/existant\/path/, content) - end - - def test_template_is_executed_when_supplied - path = "http://gist.github.com/103208.txt" - template = %{ say "It works!" } - template.instance_eval "def read; self; end" # Make the string respond to read - - generator([destination_root], :template => path).expects(:open).with(path, 'Accept' => 'application/x-thor-template').returns(template) - assert_match(/It works!/, capture(:stdout) { generator.invoke_all }) - end - def test_template_is_executed_when_supplied_an_https_path path = "https://gist.github.com/103208.txt" template = %{ say "It works!" } -- cgit v1.2.3