t/rt/28843.t
raw| 1 | #!/usr/bin/perl |
| 2 | use strict; |
| 3 | use warnings; |
| 4 | |
| 5 | use Test::More tests => 5; |
| 6 | |
| 7 | my $class = 'Business::ISBN'; |
| 8 | |
| 9 | use_ok( $class ); |
| 10 | |
| 11 | # this should not croak |
| 12 | my $isbn = eval { $class->new('1234567890123') }; |
| 13 | ok( defined $isbn, "ISBN object is not defined (good)" ); |
| 14 | isa_ok( $isbn, $class ); |
| 15 | |
| 16 | ok( ! $isbn->is_valid, "ISBN is not valid" ); |
| 17 | is( $isbn->error, $isbn->INVALID_PREFIX, "Error is an invalid prefix" ); |
| 18 |