aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorJosef Šimánek <josef.simanek@gmail.com>2013-07-13 12:49:31 +0200
committerJosef Šimánek <josef.simanek@gmail.com>2013-07-16 09:38:13 +0200
commit5ecd125a62da693320da8ea7bbccd60b71f67e63 (patch)
tree2f4c94ce9b995c1762017ad49a85853589da1808 /railties/test
parent8df284a0e9fd075a7e77cbb578532950148d0f24 (diff)
downloadrails-5ecd125a62da693320da8ea7bbccd60b71f67e63.tar.gz
rails-5ecd125a62da693320da8ea7bbccd60b71f67e63.tar.bz2
rails-5ecd125a62da693320da8ea7bbccd60b71f67e63.zip
Added generated unit test for generator generator and new test:generators rake task included in test:all rake task.
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/generators/generator_generator_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/railties/test/generators/generator_generator_test.rb b/railties/test/generators/generator_generator_test.rb
index f4c975fc18..41181aee85 100644
--- a/railties/test/generators/generator_generator_test.rb
+++ b/railties/test/generators/generator_generator_test.rb
@@ -16,6 +16,10 @@ 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",
+ /require 'generators\/awesome\/awesome_generator'/
end
def test_namespaced_generator_skeleton
@@ -29,6 +33,10 @@ 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",
+ /require 'generators\/rails\/awesome\/awesome_generator'/
end
def test_generator_skeleton_is_created_without_file_name_namespace
@@ -42,6 +50,10 @@ 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",
+ /require 'generators\/awesome_generator'/
end
def test_namespaced_generator_skeleton_without_file_name_namespace
@@ -55,5 +67,9 @@ 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",
+ /require 'generators\/rails\/awesome_generator'/
end
end