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 notifications@github.comwrote:
|
|
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 notifications@github.comwrote:
|
|
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 chris@locomote.com.au 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 |