Open zaphod42 opened 12 years ago
Have basic integration using expect(something).that has_property(:foo)
. Next is to consider rspec mock integration. Since I don't use those, I'll have to figure out how they work.
RSpec::Mocks::ArgumentMatchers
shows the interface for rspec mock matchers. It comes down to having a
def ==(value)
end
Once way of doing this is creating a that(matcher)
which gets mixed in with the other rspec mock matchers. This that
method would then wrap the matcher in another matcher that just implements the ==
method.
Doing it this way would also provide a place for integrating with mocha if the returned object also implemented a matches?
method.
The matchers need to be used with RSpec. This will somehow involve getting RSpec to be able to call the matchers and report the results.
There is also the question about how the matchers will read with the RSpec syntax. I don't think
something.should has_property(:foo)
is the greatest. The problem comes from the different part of speech that RSpec puts the matcher in.