I have assertions in place in my ruby script.
Each of these assertions also has a message to describe the assertion.
So I have two questions revolving around this
I want the messages associated with each assert to display as the test progresses. Currently the Message only displays when any thing fails
The entire test exits when any assertion fails. How do i make the tests continue even if one assertion fails?
Sample code that i am using
assert_match("hey", "hey this is a test", "The word exists in the string")
So the output currently looks like -
ruby ruby11.rb -v v
Loaded suite ruby
Started
test_ruby(Ruby):
F
Finished in 40.555587 seconds.
1) Failure:
test_ruby11(Ruby11) [ruby11.rb:73]:
Text box not displayed
<false> is not true.
1 tests, 3 assertions, 1 failures, 0 errors
And i want it to look like
ruby ruby.rb -v v
Loaded suite ruby
Started
test_ruby(Ruby):
F
ok 1 - First test successful
ok 2 - The text is displayed
ok 3 - The image is present
not ok 4 - Text box not displayed
ok - The picture is visible
Finished in 40.555587 seconds.
1) Failure:
test_ruby(Ruby) [ruby11.rb:73]:
Text box not displayed
<false> is not true.
1 tests, 4 assertions, 1 failures, 0 errors
So in the above desired display, all assertion states are displayed as an when the test is executed. (Something like TAP in perl). I am new to ruby, so i am sure there is something basic I am doing wrong.
Also i have tried the verbose parameter ruby ruby.rb -v v
, while running the script. But that does not help either.
Help will be apprecaited