Skip to content

Commit

Permalink
test(open-secret-scanning-alerts-within-limits): suppress 'used only …
Browse files Browse the repository at this point in the history
…once' warning for Mojo::UserAgent

- also renamed 'file1' to 'file'
  • Loading branch information
scriptprivate authored Sep 17, 2024
1 parent b3bf36b commit 4d6756c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/open-secret-scanning-alerts-within-limits.t
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ BEGIN {
}
}

no warnings 'once';

Check failure on line 53 in tests/open-secret-scanning-alerts-within-limits.t

View workflow job for this annotation

GitHub Actions / critic

Warnings disabled at line 53, column 1. See page 431 of PBP.
*Mojo::UserAgent::new = \&MockMojoUserAgent::new;

subtest 'Open secret scanning alerts within limits' => sub {
Expand All @@ -60,7 +61,7 @@ subtest 'Open secret scanning alerts within limits' => sub {
]);

MockMojoUserAgent::setup_locations_response(200, [
{ path => 'file1.txt', start_line => 10 },
{ details => { path => 'file.txt', start_line => 10 } },
]);

my %severity_limits = (
Expand All @@ -73,7 +74,7 @@ subtest 'Open secret scanning alerts within limits' => sub {
my $result;
my $expected_output_part1 = qr/\[!\]\ Total\ of\ open\ secret\ scanning\ alerts:\ 1/xsm;
my $expected_output_part2 = qr/\[-\]\ Alert\ 1\ found\ in\ the\ following\ locations:/xsm;
my $expected_output_part3 = qr/File:\ file1\.txt,\ Start\ line:\ 10/xsm;
my $expected_output_part3 = qr/File:\ file\.txt,\ Start\ line:\ 10/xsm;
my $expected_output_part4_part1 = qr/\[-\]\ Number\ of\ secret\ scanning\ alerts\ \(/xsm;
my $expected_output_part4_part2 = qr/1\)\ is\ within\ the\ acceptable\ limit\ \(/xsm;
my $expected_output_part4_part3 = qr/1\)\./xsm;
Expand Down

0 comments on commit 4d6756c

Please sign in to comment.