Skip to content

Commit

Permalink
Add tests for TestTask#verbose and TestTask#warning
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Mike Blumtritt committed Sep 9, 2015
1 parent c34d9e0 commit c854489
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/test_rake_test_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -19,14 +20,18 @@ 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
assert_equal "Run example tests", tt.description
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

Expand Down Expand Up @@ -142,5 +147,4 @@ def test_test_files_equals

assert_equal ["a.rb", 'b.rb'], tt.file_list.to_a
end

end

0 comments on commit c854489

Please sign in to comment.