aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/commands/dbconsole_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/test/commands/dbconsole_test.rb')
-rw-r--r--railties/test/commands/dbconsole_test.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/railties/test/commands/dbconsole_test.rb b/railties/test/commands/dbconsole_test.rb
index 57074cd0ad..6d0f5ca073 100644
--- a/railties/test/commands/dbconsole_test.rb
+++ b/railties/test/commands/dbconsole_test.rb
@@ -132,6 +132,24 @@ class Rails::DBConsoleTest < ActiveSupport::TestCase
assert_match /Unknown command-line client for db/, output
end
+ def test_print_help_short
+ stdout = capture(:stdout) do
+ start({}, ['-h'])
+ end
+ assert aborted
+ assert_equal '', output
+ assert_match /Usage:.*dbconsole/, stdout
+ end
+
+ def test_print_help_long
+ stdout = capture(:stdout) do
+ start({}, ['--help'])
+ end
+ assert aborted
+ assert_equal '', output
+ assert_match /Usage:.*dbconsole/, stdout
+ end
+
private
attr_reader :aborted, :output