On Sep 8, 2010, at 5:19 PM, Brian Kaney wrote: > On Sep 8, 2010, at 2:17 PM, "J. B. Rainsberger" <[email protected]> wrote: > >> On Wed, Sep 8, 2010 at 14:42, Brian Kaney <[email protected]> wrote: >> >>> Is it good practice to call matchers from within matchers? Kinda like >>> this pattern: >>> >>> See: http://gist.github.com/570467 >> >> David Chelimsky taught me not to invoke #should in a matcher, but >> rather just answer a boolean, so I expect that, rather than matcher >> using matcher, you could extract the low-level matcher behavior into >> methods that both matchers would use. >> > > Okay thanks. > > I'll refractor matcher logic but was hoping I could be lazy and reuse / > cascade failure messages.
You can :) The reason to avoid cascading matchers is they become somewhat useless in the negative form (should_not). If you're NEVER going to use them that way, you're fine cascading. _______________________________________________ rspec-users mailing list [email protected] http://rubyforge.org/mailman/listinfo/rspec-users
