I''m just getting back to looking at backgroundrb after a long hiatus since June. I''m looking at creating some workers but I''m a bit stuck as to how I should write tests for them. What''s the recommended approach for unit testing of workers? The project will ultimately be used by a Rails app but I''m comfortable developing the worker code as a standalone in the beginning. Any suggestions or examples? cr
* cremes.devlist at mac.com (cremes.devlist at mac.com) [061116 08:10]:> I''m just getting back to looking at backgroundrb after a long hiatus > since June. I''m looking at creating some workers but I''m a bit stuck > as to how I should write tests for them. What''s the recommended > approach for unit testing of workers?We have at this point not worked out how unittest/specs are going to work. At this point we''ve even disabled the unit test output in the worker generator for 0.2.1. There is two approaches: 1) fire up a backgroundrb server and run worker unittest against that, 2) mock the server side middleman and just test the logic of the worker class. We''ll probably end up with a combination of this. It is of course up for grabs if someone feel like spending time on it :) /skaar -- ---------------------------------------------------------------------- |\|\ where in the | s_u_b_s_t_r_u_c_t_i_o_n | | >=========== W.A.S.T.E. | genarratologies |/|/ (_) is the wisdom | skaar at waste.org ----------------------------------------------------------------------
On Thursday, November 16, 2006, at 08:47AM, "skaar" <skaar at waste.org> wrote:>* cremes.devlist at mac.com (cremes.devlist at mac.com) [061116 08:10]: >> I''m just getting back to looking at backgroundrb after a long hiatus >> since June. I''m looking at creating some workers but I''m a bit stuck >> as to how I should write tests for them. What''s the recommended >> approach for unit testing of workers? > >We have at this point not worked out how unittest/specs are going to >work. At this point we''ve even disabled the unit test output in the >worker generator for 0.2.1. > >There is two approaches: 1) fire up a backgroundrb server and run worker >unittest against that, 2) mock the server side middleman and just test >the logic of the worker class. We''ll probably end up with a combination >of this. It is of course up for grabs if someone feel like spending time >on it :)I like approach #2. If I can extract something useful from my work, I''ll donate it to the project. cr