Last change
on this file since 5501 was
5501,
checked in by aclsce, 4 years ago
|
First import of IPSLCM6.5_work_ENSEMBLES working configuration
|
-
Property svn:executable set to
*
|
File size:
969 bytes
|
Line | |
---|
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.