From fe820a772ddb6d079603f1d187b6239762141229 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Mon, 22 Jul 2013 22:43:37 -0300 Subject: Stop reading the same file twice for testing different content assert_file already gives this functionality for free by passing multiple contents. --- railties/test/generators/generator_generator_test.rb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'railties') diff --git a/railties/test/generators/generator_generator_test.rb b/railties/test/generators/generator_generator_test.rb index 41181aee85..dcfeaaa8e0 100644 --- a/railties/test/generators/generator_generator_test.rb +++ b/railties/test/generators/generator_generator_test.rb @@ -17,8 +17,7 @@ class GeneratorGeneratorTest < Rails::Generators::TestCase assert_file "lib/generators/awesome/awesome_generator.rb", /class AwesomeGenerator < Rails::Generators::NamedBase/ assert_file "test/lib/generators/awesome_generator_test.rb", - /class AwesomeGeneratorTest < Rails::Generators::TestCase/ - assert_file "test/lib/generators/awesome_generator_test.rb", + /class AwesomeGeneratorTest < Rails::Generators::TestCase/, /require 'generators\/awesome\/awesome_generator'/ end @@ -34,8 +33,7 @@ class GeneratorGeneratorTest < Rails::Generators::TestCase assert_file "lib/generators/rails/awesome/awesome_generator.rb", /class Rails::AwesomeGenerator < Rails::Generators::NamedBase/ assert_file "test/lib/generators/rails/awesome_generator_test.rb", - /class Rails::AwesomeGeneratorTest < Rails::Generators::TestCase/ - assert_file "test/lib/generators/rails/awesome_generator_test.rb", + /class Rails::AwesomeGeneratorTest < Rails::Generators::TestCase/, /require 'generators\/rails\/awesome\/awesome_generator'/ end @@ -51,8 +49,7 @@ class GeneratorGeneratorTest < Rails::Generators::TestCase assert_file "lib/generators/awesome_generator.rb", /class AwesomeGenerator < Rails::Generators::NamedBase/ assert_file "test/lib/generators/awesome_generator_test.rb", - /class AwesomeGeneratorTest < Rails::Generators::TestCase/ - assert_file "test/lib/generators/awesome_generator_test.rb", + /class AwesomeGeneratorTest < Rails::Generators::TestCase/, /require 'generators\/awesome_generator'/ end @@ -68,8 +65,7 @@ class GeneratorGeneratorTest < Rails::Generators::TestCase assert_file "lib/generators/rails/awesome_generator.rb", /class Rails::AwesomeGenerator < Rails::Generators::NamedBase/ assert_file "test/lib/generators/rails/awesome_generator_test.rb", - /class Rails::AwesomeGeneratorTest < Rails::Generators::TestCase/ - assert_file "test/lib/generators/rails/awesome_generator_test.rb", + /class Rails::AwesomeGeneratorTest < Rails::Generators::TestCase/, /require 'generators\/rails\/awesome_generator'/ end end -- cgit v1.2.3