在运行rspec spec/vector_spec.rb时,我收到了这个可怕的错误消息,我无法确定是什么规范导致了错误。
以下是错误消息的一部分:
..................F...........******************************...........F...***********************....*.....*....................................../home/ubuntu/workspace/daru/lib/daru/index.rb:102: [BUG] Segmentation fault at 0x007fe1e31ce030
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0048 p:0021 s:0197 e:000196 METHOD /home/ubuntu/workspace/daru/lib/daru/index.rb:102
c:0047 p:0015 s:0193 e:000192 METHOD /home/ubuntu/workspace/daru/lib/daru/vector.rb:207
...下面是完整的错误消息:https://gist.github.com/lokeshh/83369d71ca94b07cf89b23e215214666
我想知道是哪个规范导致了错误,这样我就可以调查一下,但我找不到一种方法来识别导致错误的规范。
有办法吗?
发布于 2016-05-28 17:09:29
您可以在RSpec文件中附加一个冒号,然后是特定测试的行号,例如:
rspec spec/vector_spec.rb:83您还可以使用=begin和=end禁用大部分代码以缩小该部分的范围。
我刚刚运行了 rspec -h ,得到了一些非常有用的信息。查看 --only-failures 和 next-failure 选项!此外,看起来您还可以使用-fd 将组和示例名称打印出来!
https://stackoverflow.com/questions/37496168
复制相似问题