Shoulda can automatically load custom macros
I wrote about creating your own shoulda macros awhile back. At that point, I was suggesting to place these in your
Now it’s even easier, thanks to a semi recent change.
You can now create put
.rb files in
test/shoulda_macros, and Shoulda will automatically pick them up. Let’s try making a will_paginate macro, and stick it out in
In the test of an imaginary
Post model, which I’m sure you can picture, we can do:
For plugin and gem authors,
vendor/plugins/*.rb will also be automatically picked up.