-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds workaround for RSpec::Given issue
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Check for whether this workaround is necessary | ||
# See: https://github.com/jimweirich/rspec-given/pull/43 | ||
if Gem::Version.new(::Given::VERSION) > Gem::Version.new('3.5.4') | ||
raise 'This may no longer be needed' | ||
end | ||
|
||
RSpec::Given::HaveFailed::HaveFailedMatcher.class_eval do | ||
def wrapped(given) | ||
given.is_a?(::Given::Failure) ? -> { given.call } : -> { } | ||
end | ||
|
||
def matches?(given_proc, negative_expectation = false) | ||
super(wrapped(given_proc), negative_expectation) | ||
end | ||
|
||
def does_not_match?(given_proc) | ||
super(wrapped(given_proc)) | ||
end | ||
end |
406cbc1
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.
@benizi: Just an FYI that I plan on releasing a fix for this at some point today if I can manage. Tracking progress in this PR: jimweirich/rspec-given#46