Dist::Zilla::Plugin::Test::Inline - Create test files for inline tests in POD sections
version 0.011000
In your dist.ini:
dist.ini
[Test::Inline]
In your module:
# My/AddressRange.pm =begin testing use Test::Exception; dies_ok { My::AddressRange->list_from_range('10.2.3.A', '10.2.3.5') } "list_from_range() complains about invalid address"; =end testing sub list_from_range { # ... }
This will result in a file t/inline-tests/my_addressrange.t in your distribution.
t/inline-tests/my_addressrange.t
This plugin integrates Test::Inline into Dist::Zilla.
Dist::Zilla
It scans all modules for inline tests in POD sections that are embedded between the keywords
=begin testing ... =end testing
and exports them into t/inline-tests/*.t files when Dist::Zilla builds your module. Multiple of these test sections may be specified within one file.
t/inline-tests/*.t
Please note that this plugin (in contrast to pure Test::Inline) can also handle Moops-like class and role definitions.
Moose::Object
Required by role Dist::Zilla::Role::FileGatherer.
Searches for inline test code in POD sections using Test::Inline, creates in-memory test files and passes them to Dist::Zilla.
The code of this Dist::Zilla file gatherer plugin is mainly taken from https://github.com/moose/moose/blob/master/inc/ExtractInlineTests.pm.
Dave Rolsky <autarch@urth.org>, who basically wrote all this but left the honor of making a plugin of it to me ;-)
Jens Berthold <jens.berthold@jebecs.de>
This software is copyright (c) 2013 by Jens Berthold.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Dist::Zilla::Plugin::Test::Inline, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dist::Zilla::Plugin::Test::Inline
CPAN shell
perl -MCPAN -e shell install Dist::Zilla::Plugin::Test::Inline
For more information on module installation, please visit the detailed CPAN module installation guide.