I have a batch program (yes, coders like me still exist) that, while it uses the same models are our web app, it isn''t webby at all. Basically, I grind through the database and send emails. I changed the email delivery system and I want to write some testing code. The test code I had written previously was terrible and no longer worked due to neglect and schedules. So, what;s a good way to test a batch program? And end-to-end test (thank God for the test/mocks facility) will require that I use 6 or 7 tables and run through a lot of code that''s already been tested. Testing will consist of querying my mock emailer to see if it "sent" the right number of emails, etc. And then I can query tables to see if rows are properly modified. Blah. On the other hand, the emailer has a fair number (50? 60?) of generally small methods that "can''t possibly" be wrong, so unit testing isn''t floating my boat. The methods typically wrap a ActiveModel.find or iterate over an array. Of course, if I was sure that these little perfect methods were being called properly I wouldn''t need to test! So is there an alternative technique other than to just run a fake email delivery (did I mention the setup is a PITA?) and check the tables and mock emailer for expected values? --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---