[Radiant] stubbing objects in Radiant

Sean Cribbs seancribbs at gmail.com
Wed Jul 18 14:27:41 CDT 2007


Barry Hess wrote:
> Thanks for the hints, Sean.
>
> In extensions/shopping_cart/test/test_helper.rb I required the stub/mock
> model object:
>
>   require File.dirname(__FILE__) + "/mocks/test/order_mailer"
>   
Dir-glob to the rescue! Try this:

Dir[File.dirname(__FILE__) + "/mocks/test/*.rb].each do |file|
  require file
end

That will load all of your mocks in the test helper.

Sean



More information about the Radiant mailing list