From f00a39845676bd552e31f47f3588ca266d4f010a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Fri, 4 Mar 2011 13:05:27 +0100 Subject: log and readme should respect --quiet --- railties/test/generators/actions_test.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'railties/test/generators/actions_test.rb') 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) -- cgit v1.2.3