Hello Railers! I have a question regarding plugin testing. I currently have a number of plugins, most of which mix themselves either into AR (via meta- methods or direct extensions of the Base) or into AP (via pre- and postfilters). Howe am I supposed to test the former? Testing a controller is straightforward - I just create a bogus controller in my test suite. But how do I verify my AR mixins work well? To test them, I need to create a dedicated class that acts like an AR or a testing database - and for this I would need to init an additional DB. Do we have any solutions at the moment?
On 12/2/05, Julian ''Julik'' Tarkhanov <listbox-RY+snkucC20@public.gmane.org> wrote:> Hello Railers! > > I have a question regarding plugin testing. I currently have a number > of plugins, most of which mix themselves either into AR (via meta- > methods or direct extensions of the Base) or into AP (via pre- and > postfilters). Howe am I supposed to test the former? > Testing a controller is straightforward - I just create a bogus > controller in my test suite. But how do I verify my AR mixins work > well? To test them, I need to create a dedicated class that acts > like an AR or a testing database - and for this I would need to init > an additional DB. > > Do we have any solutions at the moment?I just yanked the code from the ActiveRecord tests basically. Since my table needs are very simple, I can get away with using a schema and supporting all migration-ready db''s automatically. http://techno-weenie.net/svn/projects/plugins/calculations/test/ -- rick http://techno-weenie.net
On 2-dec-2005, at 17:43, Rick Olson wrote:> On 12/2/05, Julian ''Julik'' Tarkhanov <listbox-RY+snkucC20@public.gmane.org> wrote: >> Hello Railers! >> >> I have a question regarding plugin testing. I currently have a number >> of plugins, most of which mix themselves either into AR (via meta- >> methods or direct extensions of the Base) or into AP (via pre- and >> postfilters). Howe am I supposed to test the former? >> Testing a controller is straightforward - I just create a bogus >> controller in my test suite. But how do I verify my AR mixins work >> well? To test them, I need to create a dedicated class that acts >> like an AR or a testing database - and for this I would need to init >> an additional DB. >> >> Do we have any solutions at the moment? > > I just yanked the code from the ActiveRecord tests basically. Since > my table needs are very simple, I can get away with using a schema and > supporting all migration-ready db''s automatically. > > http://techno-weenie.net/svn/projects/plugins/calculations/test/Ok, looks good. I''ll be stealing this.