Bug 22844: Fix yaml_valid.t - don't pick .json files
Only .pref are considered yaml files. kohadev-koha@kohadevbox:/kohadevbox/koha$ time prove xt/yaml_valid.t xt/yaml_valid.t .. 1/19 # Failed test 'borrowers.json is YAML' # at xt/yaml_valid.t line 39. # Failed test 'items.json is YAML' # at xt/yaml_valid.t line 39. # Looks like you failed 2 tests of 19. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
01ab775440
commit
1326fa076b
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
use Modern::Perl;
|
||||
use Test::YAML::Valid;
|
||||
use Data::Dumper;
|
||||
use File::Find;
|
||||
|
||||
use Test::More;
|
||||
|
||||
|
|
@ -30,13 +30,19 @@ BEGIN {
|
|||
|
||||
my $filebase = "$FindBin::Bin/../koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences";
|
||||
|
||||
my @files = `ls -1 $filebase`;
|
||||
my @files;
|
||||
sub wanted {
|
||||
my $name = $File::Find::name;
|
||||
push @files, $name
|
||||
if $name =~ /\.pref/;
|
||||
}
|
||||
find({ wanted => \&wanted, no_chdir => 1 }, $filebase);
|
||||
|
||||
plan tests => scalar @files;
|
||||
|
||||
foreach my $f (@files) {
|
||||
chomp $f;
|
||||
yaml_file_ok( "$filebase/$f", "$f is YAML" );
|
||||
yaml_file_ok( $f, "$f is YAML" );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue