perltestingdist-zilla

Writing a test for a Dist::Zilla minting module


It's about time I wrote a functionality test for Dist::Zilla::Plugin::Catalyst. But I realized that I haven't a clue on where to start. I know that I have to have a custom minting profile recognized by my test suite, and that I'm probably going to just test to make sure that all the right files are output with suitable perms. I'm not at all sure what DZ module to you use for including the minting profile, or how to then start a mint, and then check the output ( because I suspect that it's going to use a temp directory ).

Could someone give me some pointers? are there any other minting modules, that have tests?


Solution

  • The official Dist::Zilla tutorial now has a page on writing and testing new plugins. This covers plugins in general, not minting plugins specifically, but there's nothing particularly special or different about doing it for minting plugins. You can see t/minter., as suggested, to see just how similar it is.

    Test::DZil is now shipped with Dist::Zilla and installed for use by other plugins, and I use it for testing all my non-core plugins.