Ruby on rails rspec测试期间方法中的断点
我想在rspec测试期间在方法中启动调试器。我知道,我可以在spec()中完成,我的Ruby on rails rspec测试期间方法中的断点,ruby-on-rails,debugging,rspec,breakpoints,Ruby On Rails,Debugging,Rspec,Breakpoints,我想在rspec测试期间在方法中启动调试器。我知道,我可以在spec()中完成,我的.rspec文件中有--debug 我想将调试器放入正在测试的方法中: 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
.rspec
文件中有--debug
我想将调试器放入正在测试的方法中:
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
或guard
或rspec
)时,breakpoind不起作用 您应该将调试器gem放在gemfile中的:test组下
gem 'debugger', group: [:development, :test]