I think you could mock inside the test file… perhaps your plugin needs
to be slightly more configurable so that you can feed it fixture data
or a mocked DBI or something?

FWIW this is one of my tests, doesn't solve your specific issue I
think but might help you think about it:
https://github.com/pangyre/p5-template-plugin-gravatar/blob/master/t/gravatar.t

On Fri, Jan 16, 2015 at 10:48 AM, Tom Green <[email protected]> wrote:
> I wrote a custom template toolkit plugin and was looking for the best way to
> write the unit tests for it.
>
>
>
> Does anyone have suggestions? Or a good example on the web somewhere. Google
> was no help.
>
>
>
> I looked at the unit test framework in Template::Test, but didn’t find any
> that use mocking which I need since my plugin loads data and I want to
> replace that with a specific set in my plugin unit tests.
>
>
>
> Any help would be appreciated.
>
>
>
> Tom
>
>
> _______________________________________________
> templates mailing list
> [email protected]
> http://mail.template-toolkit.org/mailman/listinfo/templates
>

_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to