Blame t/noredef.t

Packit 9002b2
use strict;
Packit 9002b2
use warnings;
Packit 9002b2
Packit 9002b2
use Test::More;
Packit 9002b2
Packit 9002b2
use DateTime::Format::Builder;
Packit 9002b2
Packit 9002b2
my %parsers = (
Packit 9002b2
    parsers => {
Packit 9002b2
        parse_datetime => {
Packit 9002b2
            length => 8,
Packit 9002b2
            regex  => qr/^abcdef$/,
Packit 9002b2
            params => [qw( year month day )],
Packit 9002b2
        }
Packit 9002b2
    }
Packit 9002b2
);
Packit 9002b2
Packit 9002b2
# Verify method (non-)creation
Packit 9002b2
Packit 9002b2
# Ensure we don't have people wiping out their other methods
Packit 9002b2
{
Packit 9002b2
    my $class = 'SampleClassHasParser';
Packit 9002b2
    sub SampleClassHasParser::parse_datetime { return "4" }
Packit 9002b2
    eval q[
Packit 9002b2
    package SampleClassHasParser;
Packit 9002b2
    use DateTime::Format::Builder
Packit 9002b2
        constructor => 1,
Packit 9002b2
        %parsers;
Packit 9002b2
    1;
Packit 9002b2
    ];
Packit 9002b2
    ok( $@, "Error when creating class." );
Packit 9002b2
}
Packit 9002b2
Packit 9002b2
done_testing();