1

I'd like to start debugger in methods during rspec test. I know, I can do it in the spec (like in this question), I have --debug in my .rspec file.

I'd like to put debugger in a methods that is under tests:

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

When I do something similar to that example and run rspec (using rake spec or guard or rspec) the breakpoind doesn't work.

Community
  • 1
  • 1
mrzasa
  • 22,895
  • 11
  • 56
  • 94

1 Answers1

3

You should put your debugger gem under the :test group in your gemfile.

gem 'debugger', group: [:development, :test]
Suborx
  • 3,647
  • 2
  • 19
  • 30