From: Ryan Davis Date: 2009-12-31T08:46:05+09:00 Subject: Re: Test::unit assertion pass scenario On Dec 30, 2009, at 12:08 , John Smith wrote: > When using the test::unit assertion, such as assert_equal, the script > will throw a failure if the test condition (assertion) is not met. If it > does pass, no output is displayed. > > Is there a way to force the results of the test to display both passes > and failures? how are you using it?? Normally it displays something like: > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -w -I../../minitest/dev/lib:lib:ext:bin:test -e 'require "rubygems"; require "minitest/autorun"; require "test/test_autotest.rb"; require "test/test_focus.rb"; require "test/test_unit_diff.rb"; require "test/test_zentest.rb"; require "test/test_zentest_mapping.rb"' > Loaded suite -e > Started > ....................................................................................................... > Finished in 0.214105 seconds. > > 103 tests, 259 assertions, 0 failures, 0 errors, 0 skips (this is for minitest, not test/unit, but the output is very similar) Your test should be set up like: > # test_blah.rb: > require 'test/unit' > > class TestThingy < Test::Unit::TestCase > def test_thingy > assert_equal 2, 1+1 > end > end. Here is a run: > % ruby > require 'test/unit' > > class TestThingy < Test::Unit::TestCase > def test_thingy > assert_equal 2, 1+1 > end > end > ^d > Loaded suite - > Started > . > Finished in 0.000706 seconds. > > 1 tests, 1 assertions, 0 failures, 0 errors >