App-ClusterSSH

 view release on metacpan or  search on metacpan

t/05getopts.t  view on Meta::CPAN

use strict;
use warnings;

# Force use of English in tests for the moment, for those users that
# have a different locale set, since errors are hardcoded below
use POSIX qw(setlocale locale_h);
setlocale( LC_ALL, "C" );

package Test::ClusterSSH::Mock;

# generate purpose object used to simplfy testing

sub new {
    my ( $class, %args ) = @_;
    my $config = {
        comms           => 'testing',
        key_addhost     => 'x',
        key_clientname  => 'x',
        key_localname   => 'x',
        key_quit        => 'x',
        key_retilehosts => 'x',
        key_username    => 'x',
        %args
    };
    return bless $config, $class;
}

sub parent {
    my ($self) = @_;
    return $self;
}

sub VERSION {
    my ($self) = @_;
    return 'TESTING';
}

sub config {
    my ($self) = @_;
    return $self;
}

sub load_configs {
    my ($self) = @_;
    return $self;
}

sub config_file {
    my ($self) = @_;
    return {};
}

1;

package main;

use FindBin qw($Bin);
use lib "$Bin/../lib";

use Test::More;
use Test::Trap;

BEGIN { use_ok('App::ClusterSSH::Getopt') }

my $getopts;

my $mock_object = Test::ClusterSSH::Mock->new();



( run in 0.964 second using v1.01-cache-2.11-cpan-ceb78f64989 )