Skip to content

Commit

Permalink
Remove redundant wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
pirj committed Dec 12, 2020
1 parent fda2a8e commit 3ff3dd2
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions lib/rspec/matchers/built_in/match.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def can_safely_call_match?(expected, actual)
def match_captures(expected, actual)
match = actual.match(expected)
if match
match = MatchData.new(match)
if match.names.empty?
values_match?(@expected_captures, match.captures)
else
Expand All @@ -66,31 +65,6 @@ def match_captures(expected, actual)
end
end
end

# @private
class MatchData
def initialize(match_data)
@match_data = match_data
end

# @api private
# Returns match data names for named captures
# @return Array
def names
match_data.names
end

# @api private
# returns an array of captures from the match data
# @return Array
def captures
match_data.captures
end

protected

attr_reader :match_data
end
end
end
end

0 comments on commit 3ff3dd2

Please sign in to comment.