source: branches/UKMO/r6232_tracer_advection/NEMOGCM/EXTERNAL/fcm/t/Fcm/CLI/Invoker.t @ 9295

Last change on this file since 9295 was 9295, checked in by jcastill, 3 years ago

Remove svn keywords

File size: 969 bytes
Line 
1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use Test::More qw{no_plan};
7
8main();
9
10sub main {
11    my $class = 'Fcm::CLI::Invoker';
12    use_ok($class);
13    test_normal($class);
14}
15
16################################################################################
17# Tests normal usage
18sub 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.