Bug #984
closedTest::Unit::Assertions#assert_match double counts number of assertions
Description
=begin
Ruby 1.9.1-rc1 にて、Test::Unit::Assertions#assert_match が
assertionsの数を1回あたり2ずつ増やしています。
なお、failure の数は正しく増えています。
以下の例では、2回しかassert_matchを実行しないはずなのに"4 assertions"になっています。
$ ruby191rc1 -v -r test/unit -e 'class A<Test::Unit::TestCase; def test_a; assert_match(/a/, "a"); end; def test_b; assert_match(/b/, "a"); end; end'
ruby 1.9.1 (2008-12-30 patchlevel-0 revision 21203) [i686-linux]
Loaded suite -e
Started
.F
Finished in 0.001318 seconds.
- Failure:
test_b(A) [-e:1]:
Expected /b/ to match "a".
2 tests, 4 assertions, 1 failures, 0 errors, 0 skips
1.8.7 では正しくカウントしています。
% ruby187p72 -v -r test/unit -e 'class A<Test::Unit::TestCase; def test_a; assert_match(/a/, "a"); end; def test_b; assert_match(/b/, "a"); end; end'
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux]
Loaded suite -e
Started
.F
Finished in 0.030196 seconds.
- Failure:
test_b(A) [-e:1]:
<"a"> expected to be =~
</b/>.
2 tests, 2 assertions, 1 failures, 0 errors
=end