Hi there,
Facade design pattern?
Try to keep your rake files as simple as possible.
The best would be to extract all the logic to the separate lib file
and just call the logic from rake task.
task :daily_summary => :environment do
#extract params
day = ENV[''DAY'']
DailySummary.process(day)
end
This way you can test your lib easily.
Cheers
On 31 Paź, 10:08, Vamsi Krishna
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> hi,
>
> i don''t ''ve idea about how to write test cases for a
rake task(rake
> file)
>
> like i''ve a rake file named daily_summary.rake and i had written
some
> code like extracting from the database based on some criteria. and the
> rake file is executed , its working fine.
>
> but i need to write test cases for this rake
> file(daily_summary.rake)
> so any body can help me how to write test cases for rake file.
>
> Thanks
> Vamsi.
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---