# \[Bug #984\] Test::Unit::Assertions#assert\_match double counts number of assertions

**URL:** <https://www.ruby-forum.com/t/bug-984-test-assertions-assert-match-double-counts-number-of-assertions/156932>\
**Category:** Development\
**Created:** [January 5, 2009, 2:17pm UTC](https://www.ruby-forum.com/t/bug-984-test-assertions-assert-match-double-counts-number-of-assertions/156932 "2009-01-05T14:17:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Naohisa\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f4b2a3/32.png) [@Naohisa\_G](https://www.ruby-forum.com/u/Naohisa_G)\
**Post date:** [January 5, 2009, 2:17pm UTC](https://www.ruby-forum.com/t/bug-984-test-assertions-assert-match-double-counts-number-of-assertions/156932/1 "2009-01-05T14:17:01Z")

</div>

Bug #984: Test::Unit::Assertions#assert\_match double counts number of  
assertions  
[http://redmine.ruby-lang.org/issues/show/984](http://redmine.ruby-lang.org/issues/show/984)

e$B5/I\<\<Te(B: Naohisa G.  
e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal

Ruby 1.9.1-rc1 e$B$K$F!“e(BTest::Unit::Assertions#assert\_match e$B$,e(B  
assertionse$B$N?t$re(B1e$B2s$”$?$je(B2e$B$:$DA}$d$7$F$$$^$9!#e(B  
e$B$J$\*!"e(Bfailure e$B$N?t$O@5$7$/A}$($F$$$^$9!#e(B

e$B0J2\<$NNc$G$O!"e(B2e$B2s$7$+e(Bassert\_matche$B$r\<B9T$7$J$$$O$:$J$N$Ke(B"4  
assertions"e$B$K$J$C$F$$$^$9!#e(B

$ 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.

1. Failure:  
test\_b(A) [-e:1]:  
Expected /b/ to match “a”.

2 tests, 4 assertions, 1 failures, 0 errors, 0 skips

1.8.7 e$B$G$O@5$7$/%+%&%s%H$7$F$$$^$9!#e(B

% 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.

1. Failure:  
test\_b(A) [-e:1]:  
\<“a”\> expected to be =~  
\</b/\>.

2 tests, 2 assertions, 1 failures, 0 errors

---

<div class="post-metadata">

**Author:** ![Naohisa\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f4b2a3/32.png) [@Naohisa\_G](https://www.ruby-forum.com/u/Naohisa_G)\
**Post date:** [January 5, 2009, 2:42pm UTC](https://www.ruby-forum.com/t/bug-984-test-assertions-assert-match-double-counts-number-of-assertions/156932/2 "2009-01-05T14:42:51Z")

</div>

okkez e$B$G$9!#e(B

2009/1/5 Naohisa G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Bug #984: Test::Unit::Assertions#assert\_match double counts number of assertions  
> [http://redmine.ruby-lang.org/issues/show/984](http://redmine.ruby-lang.org/issues/show/984)
> 
> e$B5/I\<\<Te(B: Naohisa G.  
> e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal
> 
> Ruby 1.9.1-rc1 e$B$K$F!“e(BTest::Unit::Assertions#assert\_match e$B$,e(B  
> assertionse$B$N?t$re(B1e$B2s$”$?$je(B2e$B$:$DA}$d$7$F$$$^$9!#e(B  
> e$B$J$\*!"e(Bfailure e$B$N?t$O@5$7$/A}$($F$$$^$9!#e(B

assert\_match e$B0J30$G$be(B assert\_respond\_to  
e$B$G%a%=%C%I$NB8:\_%A%'%C%/$r$7$F$$$k$?$ae(B  
assertions e$B$,Fs2sA}$($k$b$N$,$$$/$D$+$"$j$^$9!#e(B

- assert\_match
- assert\_empty
- assert\_includes
- e$BBP1~$9$ke(B refute\_\*

e$B0l2s$Ne(B assert\_\* e$B8F$S=P$7$GFs2se(B assertions  
e$B$,A}$($k$N$O$&$l$7$/$J$$$H;W$$$^$9!#e(B

---

<div class="post-metadata">

**Author:** ![Naohisa\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f4b2a3/32.png) [@Naohisa\_G](https://www.ruby-forum.com/u/Naohisa_G)\
**Post date:** [January 29, 2009, 2:25pm UTC](https://www.ruby-forum.com/t/bug-984-test-assertions-assert-match-double-counts-number-of-assertions/156932/3 "2009-01-29T14:25:02Z")

</div>

e$B%A%1%C%He(B #984 e$B$,99?7$5$l$^$7$?!#e(B (by Naohisa G.)

r21599e$B$Oe(Br21695e$B$Ge(Breverte$B$5$l$F$$$k$?$a!"e(B1.9.1-rc2e$B$G$O:FH/$7$F$$$^$9!#e(B  
e$B$^$?!"8=;~E@$Ne(BRUBY\_1\_9\_1e$B$\*$h$Se(Btrunke$B$G$bF1MM$K:FH/$7$F$$$k$h$&$G$9!#e(B  
Bug #984e$B$r:Fe(Bopene$B$9$k$3$H$r4uK\>$7$^$9!#e(B

assertionse$B$N?t$,e(B2e$BA}$($k$N$,7y$J$N$O!"e(BRuby  
1.8.xe$B$He(B1.9.1e$B$NN\>J}$GF0$/e(B  
e$B%W%m%0%i%`$r:n@.$9$k:]$K!“N\>%P!\<%8%g%s$G%F%9%H$rAv$i$;$?$H$-$Ne(B  
assertionse$B$N?t$,0lCW$9$k$N$r3NG’$9$k$3$H$G!”%F%9%H\<+BN$r4^$a$Fe(B  
e$BJQ$J$3$H$,H/@8$;$:A[DjDL$jF0$$$F$$$k$+$I$&$+$r8+$?$$$+$i$G$9!#e(B

* * *

[http://redmine.ruby-lang.org/issues/show/984](http://redmine.ruby-lang.org/issues/show/984)

---

<div class="post-metadata">

**Author:** ![Naohisa\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f4b2a3/32.png) [@Naohisa\_G](https://www.ruby-forum.com/u/Naohisa_G)\
**Post date:** [January 30, 2009, 3:07am UTC](https://www.ruby-forum.com/t/bug-984-test-assertions-assert-match-double-counts-number-of-assertions/156932/4 "2009-01-30T03:07:35Z")

</div>

e$B%A%1%C%He(B #984 e$B$,99?7$5$l$^$7$?!#e(B (by Nobuyoshi N.)

e$B%9%F!\<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B  
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

## Applied in changeset r21887.

[http://redmine.ruby-lang.org/issues/show/984](http://redmine.ruby-lang.org/issues/show/984)

---

<div class="post-metadata">

**Author:** ![Naohisa\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f4b2a3/32.png) [@Naohisa\_G](https://www.ruby-forum.com/u/Naohisa_G)\
**Post date:** [January 16, 2009, 6:07am UTC](https://www.ruby-forum.com/t/bug-984-test-assertions-assert-match-double-counts-number-of-assertions/156932/5 "2009-01-16T06:07:33Z")

</div>

e$B%A%1%C%He(B #984 e$B$,99?7$5$l$^$7$?!#e(B (by Yuki S.)

e$B%9%F!\<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B

## applied in r21599.

[http://redmine.ruby-lang.org/issues/show/984](http://redmine.ruby-lang.org/issues/show/984)
