summaryrefslogtreecommitdiff
path: root/test/rake/test_rake_application_options.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rake/test_rake_application_options.rb')
-rw-r--r--test/rake/test_rake_application_options.rb25
1 files changed, 20 insertions, 5 deletions
diff --git a/test/rake/test_rake_application_options.rb b/test/rake/test_rake_application_options.rb
index 004b8ef3acd..6a8aba652b8 100644
--- a/test/rake/test_rake_application_options.rb
+++ b/test/rake/test_rake_application_options.rb
@@ -228,7 +228,7 @@ class TestRakeApplicationOptions < Rake::TestCase
end
def test_trace_with_stdout
- flags('--trace=stdout', '-tstdout', '-t stdout') do |opts|
+ flags('--trace=stdout', '-tstdout') do |opts|
assert opts.trace, "should enable trace option"
assert opts.backtrace, "should enabled backtrace option"
assert_equal $stdout, opts.trace_output
@@ -238,7 +238,7 @@ class TestRakeApplicationOptions < Rake::TestCase
end
def test_trace_with_stderr
- flags('--trace=stderr', '-tstderr', '-t stderr') do |opts|
+ flags('--trace=stderr', '-tstderr') do |opts|
assert opts.trace, "should enable trace option"
assert opts.backtrace, "should enabled backtrace option"
assert_equal $stderr, opts.trace_output
@@ -254,13 +254,21 @@ class TestRakeApplicationOptions < Rake::TestCase
assert_match(/un(known|recognized).*\btrace\b.*xyzzy/i, ex.message)
end
+ def test_trace_with_following_task_name
+ flags(['--trace', 'taskname'], ['-t', 'taskname']) do |opts|
+ assert opts.trace, "should enable trace option"
+ assert opts.backtrace, "should enabled backtrace option"
+ assert_equal $stderr, opts.trace_output
+ assert Rake::FileUtilsExt.verbose_flag
+ assert_equal ['taskname'], @app.top_level_tasks
+ end
+ end
def test_backtrace
flags('--backtrace') do |opts|
assert opts.backtrace, "should enable backtrace option"
assert_equal $stderr, opts.trace_output
assert ! opts.trace, "should not enable trace option"
- assert ! Rake::FileUtilsExt.verbose_flag
end
end
@@ -269,7 +277,6 @@ class TestRakeApplicationOptions < Rake::TestCase
assert opts.backtrace, "should enable backtrace option"
assert_equal $stdout, opts.trace_output
assert ! opts.trace, "should not enable trace option"
- assert ! Rake::FileUtilsExt.verbose_flag
end
end
@@ -278,7 +285,6 @@ class TestRakeApplicationOptions < Rake::TestCase
assert opts.backtrace, "should enable backtrace option"
assert_equal $stderr, opts.trace_output
assert ! opts.trace, "should not enable trace option"
- assert ! Rake::FileUtilsExt.verbose_flag
end
end
@@ -289,6 +295,15 @@ class TestRakeApplicationOptions < Rake::TestCase
assert_match(/un(known|recognized).*\bbacktrace\b.*xyzzy/i, ex.message)
end
+ def test_backtrace_with_following_task_name
+ flags(['--backtrace', 'taskname']) do |opts|
+ assert ! opts.trace, "should enable trace option"
+ assert opts.backtrace, "should enabled backtrace option"
+ assert_equal $stderr, opts.trace_output
+ assert_equal ['taskname'], @app.top_level_tasks
+ end
+ end
+
def test_trace_rules
flags('--rules') do |opts|
assert opts.trace_rules