Net-OpenSSH-More.t 801 B

12345678910111213141516171819202122232425262728293031
  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. 'DESTROY' => undef,
  16. );
  17. my $obj = Net::OpenSSH::More->new( 'localhost' );
  18. is( ref $obj, 'Net::OpenSSH::More', "Got right ref type for object upon instantiation" );
  19. };
  20. subtest "Live tests versus localhost" => sub {
  21. plan 'skip_all' => 'AUTHOR_TESTS not set in shell environment, skipping...' if !$ENV{'AUTHOR_TESTS'};
  22. pass("Unimplemented for now");
  23. };
  24. done_testing();