From c8544897c1960b23eea7abb2546e2288bdf87248 Mon Sep 17 00:00:00 2001 From: Mike Blumtritt Date: Wed, 9 Sep 2015 14:00:36 +0200 Subject: [PATCH] Add tests for TestTask#verbose and TestTask#warning The warning tests were absent at all. The tests for verbose did not include a test for resulting `ruby_opts_string`. 4 new asserts added --- test/test_rake_test_task.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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