title: Why doesnt byebug/pry stop at the breakpoint in Rspec ActionMailer?
body: <p>I try to debug my user_mailer.rb within my test environment. But I dont know why the debugger doesnst stop where it suppose to.</p>
  
  <p>So, the code I roughly have is:
  <code>user_mailer_spec.rb</code></p>
  
  <pre><code>describe UserMailer do
    describe '#send_notification_letters' do
      # bunch of code omitted here ...
      it 'should record itself to the database'
        expect { UserMailer.send_notification_letters(user) }.to change{SentMail.count}.by(1)
      end
    end
  end
  </code></pre>
  
  <p>In <code>user_mailer.rb</code></p>
  
  <pre><code>class UserMailer &lt; ActionMailer::Base
    def send_notification_letters(user)
      byebug # should break here but doesnt, 
             # also tried binding.pry here, also doesnt work
      # buggy code ...
      # buggy code ...
      # buggy code ...
  
      SentMail.create(...) # never reached
      mail(to:..., from:...)
    end
  end
  </code></pre>
  
  <p>The question is, why is byebug/pry not stopping in the <code>user_mail.rb</code> when i run the test <code>rspec spec/mailer/user_mailer_spec.rb</code>?</p>
  
  <p>And why?</p>
  
  <p>How to make it stop at that break point?</p>
  
  <p>Is there a bug in the debugger?</p>