【发布时间】:2014-11-14 09:39:29
【问题描述】:
是否可以以编程方式设置断点...即...启动 RubyMine 使用的调试器 ruby-debug-ide?p>
我的目标是在测试失败时以某种方式自动启动它。
【问题讨论】:
标签: ruby debugging rubymine ruby-debug-ide
是否可以以编程方式设置断点...即...启动 RubyMine 使用的调试器 ruby-debug-ide?p>
我的目标是在测试失败时以某种方式自动启动它。
【问题讨论】:
标签: ruby debugging rubymine ruby-debug-ide
当您的问题突然出现时,我正在寻找与此相关的内容。所以你想要做的是在某些(或任何)测试失败时中断?为此,您可以使用 debugger 命令。
只需将 begin...rescue 块添加到您的测试中,如下所示
begin
test 'todo' do
result = todo
assert_equal 25, result
end
rescue Minitest::Assertion => e
debugger
如果您不使用 Minitest,请将 Minitest::Assertion 替换为适当的,例如 Test::Unit::AssertionFailedError for Test::Unit .
【讨论】: