1

是否可以以编程方式设置断点...即...启动 RubyMine 使用的调试器 ruby​​-debug-ide?

我的目标是在测试失败时以某种方式自动启动它。

4

1 回答 1

0

当你的问题突然出现时,我正在寻找与此相关的东西。所以你想要做的是在某些(或任何)测试失败时中断?为此,您可以使用调试器命令。

只需将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。

于 2015-02-14T08:05:05.953 回答