App-GHGen

 view release on metacpan or  search on metacpan

t/integration.t  view on Meta::CPAN

# must produce a non-zero exit and a recognizable "Can't locate" error.
subtest 'Test::Without::Module: YAML::XS absence causes load error for Fixer' => sub {
	my $script = q(
		use Test::Without::Module 'YAML::XS';
		require App::GHGen::Fixer;
	);
	my ($out, $err);
	run3([$^X, '-Ilib', '-e', $script], \undef, \$out, \$err);
	my $exit = $? >> 8;

	cmp_ok($exit, '!=', 0, 'Child process exits non-zero when YAML::XS is blocked');
	like("$out$err", qr/Can't locate YAML/i,
		'Error output mentions the missing YAML::XS module');
};

# ---------------------------------------------------------------------------
# Subtest 17: Test::Without::Module -- Path::Tiny absence causes load error in Analyzer
# Analyzer has a hard `use Path::Tiny` dependency.  Blocking it must fail.
subtest 'Test::Without::Module: Path::Tiny absence causes load error for Analyzer' => sub {
	my $script = q(
		use Test::Without::Module 'Path::Tiny';
		require App::GHGen::Analyzer;
	);
	my ($out, $err);
	run3([$^X, '-Ilib', '-e', $script], \undef, \$out, \$err);
	my $exit = $? >> 8;

	cmp_ok($exit, '!=', 0, 'Child process exits non-zero when Path::Tiny is blocked');
	like("$out$err", qr/Can't locate Path/i,
		'Error output mentions the missing Path::Tiny module');
};

done_testing();



( run in 1.044 second using v1.01-cache-2.11-cpan-800906f7e73 )