Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Group have and be_close deprecation warnings. #449

Merged
merged 1 commit into from Feb 9, 2014

Conversation

Projects
None yet
2 participants

@JonRowe JonRowe commented on an outdated diff Feb 9, 2014

lib/rspec/matchers/built_in/have.rb
@@ -144,7 +144,7 @@ def print_deprecation_message(query_method)
deprecation_message << "or replace your expectation with something like "
deprecation_message << "`expect(#{cardinality_expression(query_method)}).#{expectation_format_method} #{suggested_matcher_expression}`"
- RSpec.deprecate("`#{expectation_expression(query_method)}`", :replacement => deprecation_message)
+ RSpec.deprecate("`#{expectation_expression(query_method)}`", :replacement => deprecation_message, :type => "the have matcher")
@JonRowe

JonRowe Feb 9, 2014

Owner

Not consistently expanded like the others ;)

@JonRowe JonRowe and 1 other commented on an outdated diff Feb 9, 2014

spec/rspec/matchers/have_spec.rb
@@ -456,6 +456,13 @@ def array.send; :sent; end
end
end
+ def expect_have_deprecation(expression, message)
+ expect(RSpec).to receive(:deprecate).with("`#{expression}`",
+ :replacement => message,
+ :type => 'the have matcher'
+ )
+ end
@JonRowe

JonRowe Feb 9, 2014

Owner

We have these collected together in support, be good to keep them all in one place..

@JonRowe

JonRowe Feb 9, 2014

Owner

If you added a type argument, you could move this and then it could be reused elsewhere...

@xaviershay

xaviershay Feb 9, 2014

Owner

ok good call. That actually exposes an inconsistency with how we are reporting deprecations (with or without backticks), but that's out of scope for this PR.

Owner

JonRowe commented Feb 9, 2014

Few minor nitpicks, LGTM otherwise

Owner

xaviershay commented Feb 9, 2014

Fixed the first, the second doesn't make sense to move because it's highly specific to this spec.

@xaviershay xaviershay added a commit that referenced this pull request Feb 9, 2014

@xaviershay xaviershay Merge pull request #449 from rspec/issue-348
Group have and be_close deprecation warnings.
a65418a

@xaviershay xaviershay merged commit a65418a into 2-99-maintenance Feb 9, 2014

1 check passed

default The Travis CI build passed
Details

@xaviershay xaviershay deleted the issue-348 branch Feb 9, 2014

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