Peter Recore wrote:
> "When we finished the definition, nothing happened. When we exited IRB,
> then our tests ran. That’s a characteristic of using IRB for our tests
> and won’t be significant as we move on."
In general, the package has this problem because the best way to run
tests is with an editor. After a change you hit one button, and this runs
the current test. If you don't have editor keystroke bindings there, get
with ZenTest's autotest, and use it to trigger a test run each time you
save your files.
The tests run when IRB exits because RubyUnit is designed to run tests
automatically if you invoke their files with 'ruby file_test.rb'. You
wouldn't need to add these lines to the bottom of each test case:
runner = Test::Unit::UI::Console::TestRunner
got = runner.run(aTestCase.suite)
badThings += got.error_count + got.failure_count
That might work in IRB, too.
--
Phlip
http://www.oreillynet.com/ruby/blog/2008/02/assert2.html