moved test code into lib/tasks