From: Aaron Patterson Date: 2011-02-24T05:01:17+09:00 Subject: [ruby-core:35354] Re: [Ruby 1.9-Bug#3972] r28668 breaks test/unit when combined with the testing rake task --n8g4imXOkfNTN/H1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 22, 2011 at 11:39:20PM +0900, Tomoyuki Chikanaga wrote: > Issue #3972 has been updated by Tomoyuki Chikanaga. >=20 >=20 > Hi, >=20 > After r30913, make test-all output warning and testunit message in test_r= ake_integration.rb like follows. >=20 > .../path/to/src/lib/test/unit.rb:43: warning: instance variable @options = not initialized > Run options:=20 >=20 > # Running tests: >=20 >=20 >=20 > Finished tests in 0.000475s, 0.0000 tests/s, 0.0000 assertions/s. >=20 > 0 tests, 0 assertions, 0 failures, 0 errors, 0 skips > ..... >=20 > Aaron san, What do you think about the following patch? Is it OK to @opti= ons =3D nil in Options#initialize? >=20 > diff --git a/lib/test/unit.rb b/lib/test/unit.rb > index 1272153..49c4e51 100644 > --- a/lib/test/unit.rb > +++ b/lib/test/unit.rb > @@ -32,6 +32,7 @@ module Test > module Options > def initialize(*, &block) > @init_hook =3D block > + @options =3D nil > super(&nil) > end > =20 > diff --git a/test/testunit/test_rake_integration.rb b/test/testunit/test_= rake_integration.rb > index bb0951d..86a0cf8 100644 > --- a/test/testunit/test_rake_integration.rb > +++ b/test/testunit/test_rake_integration.rb > @@ -24,7 +24,12 @@ class FooTest; end > eotest > end > =20 > - assert_ruby_status(%w{ -w } + [RAKE_LOADER, filename]) > + args =3D %w{ -w } + [RAKE_LOADER, filename] > + bug3972 =3D "[ruby-core:32864]" > + status =3D assert_in_out_err(args, "", > + /0 tests, 0 assertions, 0 failures, 0 errors, 0 skip= s/, > + [], bug3972) > + assert_equal(true, status.success?, bug3972) > end > end > end This patch seems good to me. This warning annoys me too so I'll apply the patch (if all tests pass). :-) --=20 Aaron Patterson http://tenderlovemaking.com/ --n8g4imXOkfNTN/H1 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) iQEcBAEBAgAGBQJNZWeIAAoJEJUxcLy0/6/Gz7gIAIsNjJCL3v+cgcJA1RYis5vu CyLYlVWQPIAeRWLsoF9yKilrvzeVczXqiiYSfvg269YfvUcFoUGvSud6piHuHucg uALcR/Pjde/YTg7HY80jpQECQ5r0k3KbD5W0ZwGC3J8WivvkbJ899l7sQg+lwWrP WllwSYFPZgAutzsVoLy4SgRdoDjBdhRyfyNJhoCbkhe/IEoqx3rL1ejo7QS1HR29 WJ0F3wwEyZDFsYwiVjoMhXUvrj6qcC0W4EVowQhNNSpm71HapJaF/cFV4N5O9bik 7nZ8WBZSfY1bw34hbdW88rqlqyM8IFM9IGCCmFFpjWLp6a5S0I3YUzI5H5OX8OY= =eLiJ -----END PGP SIGNATURE----- --n8g4imXOkfNTN/H1--