-
-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Renamed #have_same_file_content_like
matcher
#555
Renamed #have_same_file_content_like
matcher
#555
Conversation
#have_same_file_content_like
matcher#have_same_file_content_like
matcher
@mvz It looks like the following code (as of Commit 69e89bd) works perfectly when I run it on cucumber
The tests themselves will require a number of changes before we can upgrade cucumber to 3.1.0. Everything works if I remove the |
Scratch that. |
#have_same_file_content_like
matcher#have_same_file_content_like
matcher
@mvz Are you happy for me to merge this? |
@xtrasimplicity I'll have a look this weekend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rebase this onto still
so we deprecate in the 0.14.x series? That way we don't introduce deprecations in the upcoming 1.0 release. On master
, it would just be the straight rename.
RSpec::Matchers.alias_matcher :a_file_with_same_content_as, :have_same_file_content_as | ||
|
||
# Deprecated matchers | ||
module DeprecatedMatchers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can safely deprecate these in the 0.14.x series, and drop them entirely for 1.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me. I'll rebase this when I get a moment.
spec/aruba/matchers/file_spec.rb
Outdated
.to raise_error RSpec::Expectations::ExpectationNotMetError | ||
end | ||
end | ||
end | ||
end | ||
|
||
describe "to have_same_file_content_like" do | ||
it 'calls have_same_file_content_as' do | ||
expect(self).to receive(:have_same_file_content_as) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we test this some other way? Mocking self
can lead to all kinds of breakage down the line.
I think you can just test these matchers by using them as intended (though less extensively than the main tests above).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I'll change this over, too. Thanks for reviewing! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're welcome!
(I removed the Reviewable badge since Aruba doesn't use it in general.) |
Thanks for keeping this alive, it’s a change which adds clarity to the testing activity - everyone needs their head clear for that activity. |
LGTM! |
Summary
Removed
have_same_file_content_like
anda_file_with_same_content_like
matchers, and addedhave_same_file_content_as
anda_file_with_same_content_as
, as per #485. The previous methods are deprecated in the HEAD of thestill
branch.Details
Motivation and Context
To make it easier to understand what the matcher does.
How Has This Been Tested?
Added specs to ensure that the renamed methods are called.
Screenshots (if appropriate):
Types of changes
Checklist: