TestRail-Utils.t 877 B

123456789101112131415161718192021222324
  1. use strict;
  2. use warnings;
  3. use Test::More 'tests' => 8;
  4. use Test::Fatal;
  5. use TestRail::Utils;
  6. use File::Basename qw{dirname};
  7. my ($apiurl,$user,$password);
  8. #check the binary output mode
  9. is(exception {($apiurl,$password,$user) = TestRail::Utils::parseConfig(dirname(__FILE__),1)}, undef, "No exceptions thrown by parseConfig in array mode");
  10. is($apiurl,'http://hokum.bogus',"APIURL parse OK");
  11. is($user,'zippy',"USER parse OK");
  12. is($password, 'happy', 'PASSWORD parse OK');
  13. my $out;
  14. is(exception {$out = TestRail::Utils::parseConfig(dirname(__FILE__))}, undef, "No exceptions thrown by parseConfig default mode");
  15. is($out->{apiurl},'http://hokum.bogus',"APIURL parse OK");
  16. is($out->{user},'zippy',"USER parse OK");
  17. is($out->{password}, 'happy', 'PASSWORD parse OK');
  18. #Regrettably, I have yet to find a way to print to stdin without eval, so userInput will remain untested.