DateTime-Format-Baby

 view release on metacpan or  search on metacpan

t/05fatal.t  view on Meta::CPAN

# -*- encoding: utf-8; indent-tabs-mode: nil -*-
#
#     t/05fail.t - checking the error messages (using Test::Fatal)
#     Test script for DateTime::Format::Baby
#     Copyright (C) 2015, 2016, Rick Measham and Jean Forget
#
#     This program is distributed under the same terms as Perl 5.16.3:
#     GNU Public License version 1 or later and Perl Artistic License
#
#     You can find the text of the licenses in the F<LICENSE> file or at
#     L<http://www.perlfoundation.org/artistic_license_1_0>
#     and L<http://www.gnu.org/licenses/gpl-1.0.html>.
#

t/05fatal.t  view on Meta::CPAN

#     along with this program; if not, write to the Free Software Foundation,
#     Inc., <http://www.fsf.org/>.
#

use strict;
use warnings;
use Test::More;
use DateTime::Format::Baby;

BEGIN {
  eval "use Test::Fatal qw(dies_ok)";
  plan skip_all => "Test::Fatal needed"
    if $@;
}

plan(tests => 7);
dies_ok { my $baby = DateTime::Format::Baby->new('en', format => '??') } "new fails when called with odd number of parameters";
dies_ok { my $baby = DateTime::Format::Baby->new('el') } "that's all Greek for me";

my $baby = DateTime::Format::Baby->new('en');
dies_ok { $baby->language('el') } "that's all Greek for me";
dies_ok { $baby->parse_datetime('glglglglglgl') } "Bubbling baby";



( run in 3.081 seconds using v1.01-cache-2.11-cpan-54e63673c56 )