diff --git a/lib/rspec/json_expectations/matcher_factory.rb b/lib/rspec/json_expectations/matcher_factory.rb index bd0da9e..6a125b5 100644 --- a/lib/rspec/json_expectations/matcher_factory.rb +++ b/lib/rspec/json_expectations/matcher_factory.rb @@ -7,7 +7,7 @@ def initialize(matcher_name) def define_matcher(&block) RSpec::Matchers.define(@matcher_name) do |expected| - yield + self.module_eval(&block) match do |actual| traverse(expected, actual, false)