class FirstMatcher
def matches?(block)
@result = record_something do
block.call # block called for first time
end
return true
end
def supports_block_expectations?
true
end
def second_matcher?
SecondMatcher.new
end
end
class SecondMatcher
def matches?(block)
@result = record_something do
block.call # block called for second time, can I get the original @result somehow?
end
return true
end
def supports_block_expectations?
true
end
end
# usage
expect { something }.to first_matcher.second_matcher