<br><br><div><span class="gmail_quote">On 3/29/07, <b class="gmail_sendername">David Chelimsky</b> <<a href="mailto:dchelimsky@gmail.com">dchelimsky@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br>How about this?<br><br>project.should belong_to(:manager)<br>manager.should have_many(:projects)<br><br>etc<br><br>This would involve more matchers, but could be implemented in the same<br>fashion as have_association is above.
</blockquote><div><br><br>I've implenented the first pass at the following rails matchers:<br><br>should belong_to(association)<br>
should have_many(association)<br>
should validate_confirmation_of(attribute)<br>
should validate_format_of(attribute, valid => [], invalid => [])<br>
should validate_lendth_of(attribute, range)<br>
should validate_presence_of(attribute)<br>
should validate_uniqueness_of(attribute)<br><br>Plugin available here: <a href="http://svn.integrumtech.com/public/plugins/rspec_on_rails_matchers/">http://svn.integrumtech.com/public/plugins/rspec_on_rails_matchers/</a>
<br><br>I haven't had a chance to get the README done, or any rdoc, but there are specs for the majority of the matchers.<br><br>Comments / Suggestions Welcome!<br><br>Josh<br></div><br></div><br><br clear="all"><br>
-- <br>Josh Knowles<br><a href="mailto:joshknowles@gmail.com">joshknowles@gmail.com</a><br><a href="http://joshknowles.com">http://joshknowles.com</a>