We are trying to use pry-rescue inside of rspec to get a debugger when a spec fails.
Now when this expectation fails:
expect(page).to have_content('Thanks for signing up!')
pry does open, but the code point that pry is at looks like this:
From: /Users/aljoscha/.rvm/gems/ruby-2.2.2/gems/pry-rescue-1.4.4/lib/pry-rescue.rb @ line 206 PryRescue.with_program_name:
201: def with_program_name name
202: before = $PROGRAM_NAME
203: $PROGRAM_NAME = name
204: yield
205: ensure
=> 206: $PROGRAM_NAME = before
207: end
which is obviously not the code of the failing spec. From here on we can only go "up".
We expected to end right at the failing spec (as e.g. pointed out here: Start ruby debugger if rspec test fails).
Why does the above happen instead what did we do wrong?
We are using rspec 3.4.0, pry 0.10.3 and pry-rescue 1.4.4.