Issue #134: Add deprecation warning for should_not_receive followed by and_return #151

Merged
merged 1 commit into from Aug 20, 2012

Conversation

Projects
None yet
3 participants
Contributor

Bodhisattva2-0 commented Jun 11, 2012

No description provided.

This pull request passes (merged 15c84d7 into f04d527).

@dchelimsky dchelimsky referenced this pull request Jun 11, 2012

Closed

Issue134 #149

@@ -477,6 +477,8 @@ def initialize(error_generator, expectation_ordering, expected_from, message, &i
def and_return(*)
# no-op
+ # @deprecated Please do not use and_return with negative message expectations.
@dchelimsky

dchelimsky Jun 11, 2012

Owner

This comment should move to before the method (like an rdoc comment).

Owner

dchelimsky commented Jun 11, 2012

All of RSpec's other deprecation notices use either RSpec.deprecate or RSpec.warn_deprecation. Unfortunately, neither are a great option right now because RSpec.deprecate displays a message saying the behavior will be removed from a future version, which is a bit confusing in this case. I'm going to update that method to take an options hash, and then ask that you use that method instead, as it displays the line from which the deprecated method is called. Please stand by (probably a few days).

Contributor

Bodhisattva2-0 commented Jun 11, 2012

Alright David. Thanks.

Contributor

Bodhisattva2-0 commented Jul 6, 2012

Hi David, any updates on this?

Owner

dchelimsky commented Jul 6, 2012

Sorry, no. Haven't had much time for the last few weeks. This weekend I'm going to try to get the 2.11 release out. If I'm able to address this in the process I will, but I make no promises.

Owner

dchelimsky commented Aug 20, 2012

Hey - sorry I haven't followed up on this. I still haven't figured out how I want to centralize the deprecation warning behavior. I want to get this in sooner than later, so I'm going to merge it and then modify it slightly. Thanks for the pull and for your patience.

dchelimsky added a commit that referenced this pull request Aug 20, 2012

Merge pull request #151 from c42engineering/issue_134
Issue #134: Add deprecation warning for should_not_receive followed by and_return

@dchelimsky dchelimsky merged commit 5b36ea4 into rspec:master Aug 20, 2012

dchelimsky added a commit that referenced this pull request Aug 20, 2012

dchelimsky added a commit that referenced this pull request Aug 20, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment