New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Invoker.t in branches/UKMO/dev_r5518_ww3_coupling/NEMOGCM/EXTERNAL/fcm/t/Fcm/CLI – NEMO

source: branches/UKMO/dev_r5518_ww3_coupling/NEMOGCM/EXTERNAL/fcm/t/Fcm/CLI/Invoker.t @ 5844

Last change on this file since 5844 was 5844, checked in by jcastill, 8 years ago

Clear 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.