Output deprecation warning when at_least(0) is sent #231

Merged
merged 4 commits into from May 12, 2013

Projects

None yet

3 participants

@michihuber
Contributor

See #133

Owner

Thanks, @michihuber. I need to go back and read #133 to fully understand the discussion before merging this, but it looks generally good.

@myronmarston

Rather than adding a mock expectation to every example in this group (which would cause them all to fail if the warning is removed), I'd rather see something like:

before { RSpec::Mocks.stub(:warn) }

# the other examples

it 'prints a warning since this is really just a stub' do
  RSpec::Mocks.should_receive(:warn).with(/at_least\(0\) is deprecated/)
  @double.should_receive(:do_something).at_least(0).times
end
Contributor

Let me know if you also want to deprecate #any_number_of_times.

Member

I think this looks fine now. We've fixed the problems with the specs and I'm generally in favour of this. @myronmarston what do you think?

@samphippen samphippen merged commit 37d9a71 into rspec:master May 12, 2013

1 check passed

default The Travis build passed
Details
@samphippen samphippen added a commit that referenced this pull request May 12, 2013
@samphippen samphippen Add a changelog entry for #231 and #237
Signed-off-by: Sam Phippen <samphippen@googlemail.com>
2efca50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment