diff --git a/lib/rake/testtask.rb b/lib/rake/testtask.rb index 5cae95c5d..93e1ca260 100644 --- a/lib/rake/testtask.rb +++ b/lib/rake/testtask.rb @@ -128,6 +128,7 @@ def ruby_opts_string # :nodoc: opts = @ruby_opts.dup opts.unshift("-I\"#{lib_path}\"") unless @libs.empty? opts.unshift("-w") if @warning + opts.unshift('--verbose') if @verbose opts.join(" ") end diff --git a/test/test_rake_test_task.rb b/test/test_rake_test_task.rb index 5c4be797c..c5d606907 100644 --- a/test/test_rake_test_task.rb +++ b/test/test_rake_test_task.rb @@ -10,6 +10,7 @@ def test_initialize assert_equal :test, tt.name assert_equal ['lib'], tt.libs assert_equal 'test/test*.rb', tt.pattern + assert_equal false, tt.warning assert_equal false, tt.verbose assert Task.task_defined?(:test) end @@ -19,6 +20,7 @@ def test_initialize_override t.description = "Run example tests" t.libs = ['src', 'ext'] t.pattern = 'test/tc_*.rb' + t.warning = true t.verbose = true end refute_nil tt @@ -26,7 +28,10 @@ def test_initialize_override assert_equal :example, tt.name assert_equal ['src', 'ext'], tt.libs assert_equal 'test/tc_*.rb', tt.pattern + assert_equal true, tt.warning assert_equal true, tt.verbose + assert_match(/-w/, tt.ruby_opts_string) + assert_match(/--verbose/, tt.ruby_opts_string) assert Task.task_defined?(:example) end @@ -142,5 +147,4 @@ def test_test_files_equals assert_equal ["a.rb", 'b.rb'], tt.file_list.to_a end - end