Calling binding.pry from inside an expect {}.to change block causes the following error:
when_started hook failed: NoMethodError: undefined method `call' for Pry:Class
[...]/rspec-expectations-2.11.3/lib/rspec/matchers/built_in/change.rb:16:in `matches?'
(see _pry_.hooks.errors to debug)
A minimal RSpec example causing the error is:
require 'spec_helper'
require 'pry'
describe Pry do
it 'should not throw an exception when called inside expect{} block' do
x = []
expect {
binding.pry
}.not_to change(x, :size)
end
end
Using a rails application with the following gems added to the Gemfile:
Calling
binding.pry
from inside anexpect {}.to change
block causes the following error:A minimal RSpec example causing the error is:
Using a rails application with the following gems added to the Gemfile:
Removing the
pry-stack_explorer
gem from the Gemfile fixes the error, so it is probably related to this gem.