[rspec-users] method calls count weirdness...

apneadiving apnea.diving.deep at gmail.com
Fri Jan 27 11:14:20 EST 2012


Hi,

I see a really weird behavior there, the following test passes:

  it "test", :focus do
    doc = Factory.build(:document)
    doc.should_receive(:update_project!).exactly(2).times
    doc.save
  end

But when I do:

def update_project!
  binding.pry
  #some stuff
end
I enter the method 3 times through pry...

3 vs 2, who is right?


More information about the rspec-users mailing list