Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Rails单元测试:如何将我自己的输出添加到单元测试结果中_Ruby On Rails_Unit Testing - Fatal编程技术网

Ruby on rails Rails单元测试:如何将我自己的输出添加到单元测试结果中

Ruby on rails Rails单元测试:如何将我自己的输出添加到单元测试结果中,ruby-on-rails,unit-testing,Ruby On Rails,Unit Testing,当运行Rails单元测试时,我得到的输出指定了测试失败时的行号和方法,例如: 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

当运行Rails单元测试时,我得到的输出指定了测试失败时的行号和方法,例如:

  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.
1)故障:
测试\u 05\u照片\u标签\u添加\u删除(TC\u javascript02Test)
[./helper/helper.rb:6:in'handle\u assert'
./helper/helper.rb:17:in'check\u not\u string'
./helper/helper.rb:134:in'check\u for\u ajax\u remove\u string'
rb:39:test\u 05\u photo\u tag\u add\u remove']中:
事实并非如此。
是否可以将我自己的文本添加到此堆栈

提前谢谢
Peter

大多数断言采用
消息
参数,例如:

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

如果断言失败,则除了通常的测试输出外,还会显示消息。

大多数断言采用
消息
参数,例如:

assert_equal 64, obj.size, "Size should be 64"
如果断言失败,除了通常的测试输出外,还会显示消息