mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
18 lines
396 B
Ruby
18 lines
396 B
Ruby
|
require "test/unit"
|
||
|
require "coverage"
|
||
|
|
||
|
class TestCoverage < Test::Unit::TestCase
|
||
|
def test_result_without_start
|
||
|
assert_raise(RuntimeError) {Coverage.result}
|
||
|
end
|
||
|
def test_result_with_nothing
|
||
|
Coverage.start
|
||
|
result = Coverage.result
|
||
|
assert_kind_of(Hash, result)
|
||
|
result.each do |key, val|
|
||
|
assert_kind_of(String, key)
|
||
|
assert_kind_of(Array, val)
|
||
|
end
|
||
|
end
|
||
|
end
|