testrail-cases.t 951 B

123456789101112131415161718192021222324252627
  1. use strict;
  2. use warnings;
  3. use Test::More "tests" => 6;
  4. #check plan mode
  5. my @args = ($^X,qw{bin/testrail-cases -j "TestProject" -t "HAMBURGER-IZE HUMANITY" -d t/ --mock --test --extension .test});
  6. my $out = `@args`;
  7. is($? >> 8, 0, "Exit code OK running add, update, orphans");
  8. chomp $out;
  9. like($out,qr/fake\.test/,"Shows existing tests by default");
  10. @args = ($^X,qw{bin/testrail-cases -j "TestProject" -t "HAMBURGER-IZE HUMANITY" -d t/ --mock -o --extension .test});
  11. $out = `@args`;
  12. chomp $out;
  13. like($out,qr/nothere\.test/,"Shows orphan tests");
  14. @args = ($^X,qw{bin/testrail-cases -j "TestProject" -t "HAMBURGER-IZE HUMANITY" -d t/ --mock -m --extension .test});
  15. $out = `@args`;
  16. chomp $out;
  17. like($out,qr/t\/skipall\.test/,"Shows missing tests");
  18. #Verify no-match returns non path
  19. @args = ($^X,qw{bin/testrail-cases --help});
  20. $out = `@args`;
  21. is($? >> 8, 0, "Exit code OK asking for help");
  22. like($out,qr/encoding of arguments/i,"Help output OK");