Last change
on this file since 9141 was
9141,
checked in by nicolasmartin, 3 years ago
|
MIME type for Perl files under ./EXTERNAL/fcm/t
|
-
Property svn:keywords set to
Id
-
Property svn:mime-type set to
text/x-perl
|
File size:
969 bytes
|
Rev | Line | |
---|
[1980] | 1 | #!/usr/bin/perl |
---|
| 2 | |
---|
| 3 | use strict; |
---|
| 4 | use warnings; |
---|
| 5 | |
---|
| 6 | use Test::More qw{no_plan}; |
---|
| 7 | |
---|
| 8 | main(); |
---|
| 9 | |
---|
| 10 | sub main { |
---|
| 11 | my $class = 'Fcm::CLI::Invoker'; |
---|
| 12 | use_ok($class); |
---|
| 13 | test_normal($class); |
---|
| 14 | } |
---|
| 15 | |
---|
| 16 | ################################################################################ |
---|
| 17 | # Tests normal usage |
---|
| 18 | sub test_normal { |
---|
| 19 | my ($class) = @_; |
---|
| 20 | my $prefix = "normal"; |
---|
| 21 | my %OPTIONS = (option1 => 1, option2 => 2, option3 => 3); |
---|
| 22 | my @ARGUMENTS = ('argument 1', 'argument 2'); |
---|
| 23 | my $invoker = $class->new({ |
---|
| 24 | command => 'command', |
---|
| 25 | options => \%OPTIONS, |
---|
| 26 | arguments => \@ARGUMENTS, |
---|
| 27 | }); |
---|
| 28 | isa_ok($invoker, $class, $prefix); |
---|
| 29 | is($invoker->get_command(), 'command', "$prefix: command"); |
---|
| 30 | is_deeply({$invoker->get_options()}, \%OPTIONS, "$prefix: options"); |
---|
| 31 | is_deeply([$invoker->get_arguments()], \@ARGUMENTS, "$prefix: arguments"); |
---|
| 32 | eval { |
---|
| 33 | $invoker->invoke(); |
---|
| 34 | }; |
---|
| 35 | isa_ok($@, 'Fcm::CLI::Exception', "$prefix: invoke"); |
---|
| 36 | } |
---|
| 37 | |
---|
| 38 | __END__ |
---|
Note: See
TracBrowser
for help on using the repository browser.