Net-OpenSSH-More.t 905 B

123456789101112131415161718192021222324252627282930313233
  1. use strict;
  2. use warnings;
  3. use Test2::V0;
  4. use Test2::Tools::Explain;
  5. use Test2::Plugin::NoWarnings;
  6. use Test::MockModule qw{strict};
  7. use FindBin;
  8. use lib "$FindBin::Bin/../lib";
  9. use Net::OpenSSH::More;
  10. # Mock based testing
  11. subtest "Common tests using mocks" => sub {
  12. my $parent_mock = Test::MockModule->new('Net::OpenSSH');
  13. $parent_mock->redefine(
  14. 'new' => sub { bless {}, $_[0] },
  15. 'check_master' => 1,
  16. 'DESTROY' => undef,
  17. );
  18. $Net::OpenSSH::More::disable_destructor = 1;
  19. my $obj = Net::OpenSSH::More->new( '127.0.0.1', retry_max => 1 );
  20. is( ref $obj, 'Net::OpenSSH::More', "Got right ref type for object upon instantiation" );
  21. };
  22. subtest "Live tests versus localhost" => sub {
  23. plan 'skip_all' => 'AUTHOR_TESTS not set in shell environment, skipping...' if !$ENV{'AUTHOR_TESTS'};
  24. pass("Unimplemented for now");
  25. };
  26. done_testing();