aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators_test.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-01-21 14:11:24 +0100
committerJosé Valim <jose.valim@gmail.com>2010-01-21 14:11:24 +0100
commit04063393f9392b83cf5ccd0a16f217cc7261e15c (patch)
tree7486a826ec2bddd02342b6faa1bd44fe0f129606 /railties/test/generators_test.rb
parentda142cd86584d56299470ee4dd6f90be7127b477 (diff)
downloadrails-04063393f9392b83cf5ccd0a16f217cc7261e15c.tar.gz
rails-04063393f9392b83cf5ccd0a16f217cc7261e15c.tar.bz2
rails-04063393f9392b83cf5ccd0a16f217cc7261e15c.zip
Give higher priority to rails generators.
Diffstat (limited to 'railties/test/generators_test.rb')
-rw-r--r--railties/test/generators_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/railties/test/generators_test.rb b/railties/test/generators_test.rb
index 664d1e5670..f37b684f73 100644
--- a/railties/test/generators_test.rb
+++ b/railties/test/generators_test.rb
@@ -16,6 +16,7 @@ class GeneratorsTest < Rails::Generators::TestCase
end
def test_simple_invoke
+ assert File.exists?(File.join(@path, 'generators', 'model_generator.rb'))
TestUnit::Generators::ModelGenerator.expects(:start).with(["Account"], {})
Rails::Generators.invoke("test_unit:model", ["Account"])
end
@@ -30,6 +31,13 @@ class GeneratorsTest < Rails::Generators::TestCase
assert_match /Description:/, output
end
+ def test_should_give_higher_preference_to_rails_generators
+ assert File.exists?(File.join(@path, 'generators', 'model_generator.rb'))
+ Rails::Generators::ModelGenerator.expects(:start).with(["Account"], {})
+ warnings = capture(:stderr){ Rails::Generators.invoke :model, ["Account"] }
+ assert warnings.empty?
+ end
+
def test_invoke_with_default_values
Rails::Generators::ModelGenerator.expects(:start).with(["Account"], {})
Rails::Generators.invoke :model, ["Account"]