Skip to content

Give a better error message with .at_least(3).times style expectations

Created by: penelopezone

Related #252 (closed)

This is a vastly prototypical implementation. I'm not even sure if it's good or what we want, so I didn't pull the failing specs up to scratch. Any and all comments would be appreciated.

This basically makes the output of this:

  example do
    dbl = double
    dbl.should_receive(:foo).at_least(2).times
    dbl
  end

Look like this

  1) RSpec::Mocks
     Failure/Error: dbl.should_receive(:foo).at_least(2).times
       (Double).foo(any args)
           expected: at least 2 times
           received: 0 times

It does the same thing for at most.

Merge request reports