testrail-bulk-mark-results.t 912 B

123456789101112131415161718192021222324
  1. use strict;
  2. use warnings;
  3. use Test::More "tests" => 4;
  4. use FindBin;
  5. use IO::CaptureOutput qw{capture};
  6. use lib $FindBin::Bin.'/../bin';
  7. require 'testrail-bulk-mark-results';
  8. #check plan mode
  9. my @args = (qw{--apiurl http://testrail.local --user test@fake.fake --password fake -j },"CRUSH ALL HUMANS", '-r', "SEND T-1000 INFILTRATION UNITS BACK IN TIME", qw{--mock blocked}, "Build was bad.");
  10. my ($out,$code) = TestRail::Bin::BulkMarkResults::run(@args);
  11. is($code, 0, "Exit code OK running against normal run");
  12. chomp $out;
  13. like($out,qr/set the status of 1 cases to blocked/,"Sets test correctly in single run mode");
  14. @args = qw{--help};
  15. $0 = $FindBin::Bin.'/../bin/testrail-bulk-mark-results';
  16. (undef,$code) = capture {TestRail::Bin::BulkMarkResults::run(@args)} \$out, \$out;
  17. is($code, 0, "Exit code OK asking for help");
  18. like($out,qr/encoding of arguments/i,"Help output OK");
  19. #TODO more thorough testing