Revert "only use ND_PHANTOMJS env for testing"

This reverts commit b49d5aeb86.
This commit is contained in:
Oliver Gorwits
2018-01-06 13:46:55 +00:00
parent 5fe20c301d
commit ffd5c07b41

View File

@@ -3,14 +3,16 @@ use strict;
use warnings; use warnings;
use Test::More; use Test::More;
use Test::File::ShareDir::Dist { 'App-Netdisco' => 'share/' };
use Env::Path; use Env::Path;
use FindBin qw( $Bin ); use FindBin qw( $Bin );
my $phantomjs = $ENV{ND_PHANTOMJS}; my @phantomjs = Env::Path->PATH->Whence('phantomjs');
my $phantomjs = scalar @phantomjs ? $phantomjs[0] : $ENV{ND_PHANTOMJS};
if ( !defined $phantomjs or !-x $phantomjs ) { if ( ! defined $phantomjs or !-x $phantomjs ) {
plan skip_all => plan skip_all =>
"phantomjs not found, please set ND_PHANTOMJS to the location of the phantomjs executable"; "phantomjs not found, please set ND_PHANTOMJS or install phantomjs to the default location";
} }
else { else {
exec( $phantomjs, "$Bin/js/run_qunit.js", "$Bin/html/portsort.html" ); exec( $phantomjs, "$Bin/js/run_qunit.js", "$Bin/html/portsort.html" );