-
Notifications
You must be signed in to change notification settings - Fork 9
Update the RSpec matcher example #3
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
base: master
Are you sure you want to change the base?
Conversation
rehevkor5
commented
Nov 10, 2012
- The Rspec matcher example now follows recommended approach for 1.2.4 and up. The BaseMatcher class is an internal class that RSpec advises people should not use.
- The Rspec matcher example now follows recommended approach for 1.2.4 and up. The BaseMatcher class is an internal class that RSpec advises people should not use.
|
Thanks for the update! |
|
You're welcome, and thank you for making open source stuff! |
|
right back at ya! hey, btw, would you be able to send me a real life example of how you use ie. the diff matcher pattern that you're using and an example of the data (when you write a tool you never know how people will end up using it - and On Fri, Dec 7, 2012 at 3:02 PM, Shannon Carey [email protected]:
|
|
So far my use cases are very simple. Here's the data matched against: And here's the relevant part of the Rspec code: |
|
We like to make the matchers as explicit as possible. You'd be suprised how many times subtle little changes crept into our JSON, eg. Instead of defining a path to be a String actually writie a proper I had a crack at writing a more explicit matcher for you.... How's this look? DiffMatcher::Matcher.new( def link_matcher(path) On Sat, Dec 8, 2012 at 3:09 AM, Shannon Carey [email protected]:
|
|
ie. describe ArticleDecorator do let(:decorated) { ArticleDecorator.decorate(article) } describe '#as_json' do end private def link_matcher(path) On Sat, Dec 8, 2012 at 8:30 AM, Chris Ottrey [email protected] wrote:
|
|
Thanks! I'll try to move that direction. |
|
+1 on this one. I had the same issue. |
|
@sheerun - fyi diff_matcher has now moved to http://github.com/diff-matcher/diff_matcher |
|
I understand author abandoned project and don't want to change readme or transfer project |