Skip to content

Commit

Permalink
Test if this also works
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmire committed Feb 5, 2024
1 parent f0b371f commit 98a800a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/super_diff/rspec/monkey_patches.rb
Original file line number Diff line number Diff line change
Expand Up @@ -800,10 +800,10 @@ def expected_for_failure_message
end

SuperDiff.insert_overrides(self) do
def self.prepended(base)
puts "Yay, prepended was called!"
base.class_eval { alias_matcher :an_array_matching, :match_array }
end
# def self.prepended(base)
# puts "Yay, prepended was called!"
# base.class_eval { alias_matcher :an_array_matching, :match_array }
# end

def match_array(items)
# This is a bit strange, but this is fundamentally different from
Expand All @@ -815,11 +815,13 @@ def match_array(items)
items = *items
BuiltIn::MatchArray.new(items)
end
# ::RSpec::Matchers.alias_matcher :an_array_matching, :match_array # do |desc|
# ::RSpec::Matchers.
# desc.sub("contain exactly", "an array containing exactly")
# end
end

p ancestors: ancestors

alias_matcher :an_array_matching, :match_array
end
end

0 comments on commit 98a800a

Please sign in to comment.