I've written a custom Shoulda macro and placed it under *test/shoulda_macros* directory. What else should I do in order to use my custom macro in my test case file? Should I reopen TestCase class? Anything else? I am probably missing something simple. Thanks.
In shoulda 3.x, the term went from "macros," to "matchers." You can see exactly how the shoulda-matchers gem works with TestUnit here.
You can either extract your matchers into a new gem and perhaps publish the gem if it's general enough to be of use to others. Otherwise, you can extend TestCase in your test_helper.rb file, or put that code in it's own file and require it from test_helper. Something like this:
require 'lib/shoulda-matchers-custom'
module Test
module Unit
class TestCase
include Shoulda::Matchers::Custom
extend Shoulda::Matchers::Custom
end
end
end