aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-03-04 13:05:27 +0100
committerJosé Valim <jose.valim@gmail.com>2011-03-04 13:05:27 +0100
commitf00a39845676bd552e31f47f3588ca266d4f010a (patch)
treecd211e83cc9973ef6cda7fa0c13c762b20ce4cee /railties/test/generators
parent1db4969dc9cabed9db162e7194b9353d43c967d7 (diff)
downloadrails-f00a39845676bd552e31f47f3588ca266d4f010a.tar.gz
rails-f00a39845676bd552e31f47f3588ca266d4f010a.tar.bz2
rails-f00a39845676bd552e31f47f3588ca266d4f010a.zip
log and readme should respect --quiet
Diffstat (limited to 'railties/test/generators')
-rw-r--r--railties/test/generators/actions_test.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/railties/test/generators/actions_test.rb b/railties/test/generators/actions_test.rb
index 4b29afdc8f..68d4c17623 100644
--- a/railties/test/generators/actions_test.rb
+++ b/railties/test/generators/actions_test.rb
@@ -191,6 +191,31 @@ class ActionsTest < Rails::Generators::TestCase
assert_match(/Welcome to Rails/, action(:readme, "README"))
end
+ def test_readme_with_quiet
+ generator(default_arguments, :quiet => true)
+ run_generator
+ Rails::Generators::AppGenerator.expects(:source_root).times(2).returns(destination_root)
+ assert_no_match(/Welcome to Rails/, action(:readme, "README"))
+ end
+
+ def test_log
+ assert_equal("YES\n", action(:log, "YES"))
+ end
+
+ def test_log_with_status
+ assert_equal(" yes YES\n", action(:log, :yes, "YES"))
+ end
+
+ def test_log_with_quiet
+ generator(default_arguments, :quiet => true)
+ assert_equal("", action(:log, "YES"))
+ end
+
+ def test_log_with_status_with_quiet
+ generator(default_arguments, :quiet => true)
+ assert_equal("", action(:log, :yes, "YES"))
+ end
+
protected
def action(*args, &block)