Exception.t 569 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4. use Test::More qw{no_plan};
  5. main();
  6. sub main {
  7. my $class = 'Fcm::Keyword::Exception';
  8. use_ok($class);
  9. test_normal($class);
  10. }
  11. ################################################################################
  12. # Tests normal usage
  13. sub test_normal {
  14. my ($class) = @_;
  15. my $prefix = 'normal';
  16. my $e = $class->new({message => 'message'});
  17. isa_ok($e, $class, $prefix);
  18. is("$e", "$class: message\n", "$prefix: as_string()");
  19. is($e->get_message(), 'message', "$prefix: get_message()");
  20. }
  21. __END__