Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSpec integration #6

Open
zaphod42 opened this issue Jul 1, 2012 · 2 comments
Open

RSpec integration #6

zaphod42 opened this issue Jul 1, 2012 · 2 comments

Comments

@zaphod42
Copy link
Member

zaphod42 commented Jul 1, 2012

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.

@zaphod42
Copy link
Member Author

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.

@zaphod42
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant