1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
package TestFor::Code::TidyAll::DiffOnTidyError;
use Test::Class::Most parent => 'TestHelper::Test::Class';
use strict;
use warnings;
sub test_diff_on_tidy_error : Tests {
my $self = shift;
$self->tidy(
plugins => {
'+TestHelper::Plugin::UpperText' => {
diff_on_tidy_error => 1,
select => '**/*.txt',
},
},
source => { 'foo.txt' => 'abc' },
options => { check_only => 1 },
desc => 'diff on tidy error',
errors => qr/needs tidying/,
like_output => qr/UpperText made the following change:\n.+abc\n.+ABC/s,
);
$ENV{GITHUB_ACTIONS} = 'true';
$self->tidy(
plugins => {
'+TestHelper::Plugin::UpperText' => {
diff_on_tidy_error => 1,
select => '**/*.txt',
},
},
source => { 'foo.txt' => 'abc' },
options => { check_only => 1 },
desc => 'diff on tidy error running in github actions',
errors => qr/::error file=foo\.txt::File foo\.txt needs tidying/,
);
}
1;
|