我想在 rspec 测试期间在方法中启动调试器。我知道,我可以在规范中做到这一点(就像在这个问题中一样),我--debug
在我的.rspec
文件中。
我想debugger
输入一个正在测试的方法:
it "should be OK" do
User.ok? should be_true
end
class User
def ok?
do_something
debugger #here is my breakpoint
do_something
end
end
当我执行与该示例类似的操作并运行 rspec (使用rake spec
orguard
或rspec
)时,断点不起作用。