I use shoulda constantly as it is my favorite testing framework. I figured the custom macros I write may prove useful to others, thus I released them as a plugin called shmacros. As of now it includes the following methods.
- should_accept_nested_attributes_for
- should_act_as_taggable_on
- should_be
- should_callback
- should_delegate
should_have_attached_file(removed in new revision)- should_validate_associated
<p>It’s best to have <a href="http://mocha.rubyforge.org">Mocha</a> installed as some of the macros rely on its presence.</p>
~/dev/myapp% script/plugin install git://github.com/maxim/shmacros.git
[...] Shmacros – A bunch of useful shoulda macros. [...]
Hi.
Nice post, I’ll be adding the should_delegate macro to my current project.
A question though, why wouldn’t you use the macro that comes with Paperclip?
Hm, frankly I can’t remember. Perhaps at the time I made it this wasn’t part of Paperclip. Will probably remove it. : )
There was a time when paperclip’s shoulda macro was busted because I had to roll my own on an older project too. I faintly remember talking about this with @bryanl. Anyways, thanks for sharing man!
just stumbled on this. looks cool
know if I’m good to go with Rails 3 + Rspec 2?