views:

40

answers:

1

Hi, When running Rails unit tests I get output specifying line numbers and methods when a test fails, e.g.:

  1) Failure:
test_05_photo_tag_add_remove(TC_javascript02Test)
    [./helper/helper.rb:6:in `handle_assert'
     ./helper/helper.rb:17:in `check_not_string'
     ./helper/helper.rb:134:in `check_for_ajax_remove_string'
     javascript.rb:39:in `test_05_photo_tag_add_remove']:
<false> is not true.

Is it possible to dd my own text to this stack?

Thanks in advance Peter

+1  A: 

Most assertions take a message parameter, for example:

assert_equal 64, obj.size, "Size should be 64"

If the assertion fails, the message will be displayed in addition to the usual test output.

Alex Reisner
Thanks for that, Alex
Peter