-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throw an exception if the program exited non-zero
- Loading branch information
Arthur Axel 'fREW' Schmidt
committed
May 16, 2015
1 parent
c556ede
commit dd8d1d5
Showing
5 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
use strict; | ||
use warnings; | ||
|
||
use Test::More; | ||
use Test::Fatal; | ||
|
||
use Pod::Elemental; | ||
use Pod::Elemental::Transformer::Pod5; | ||
use Pod::Weaver::Plugin::Exec; | ||
|
||
my $str = do { local $/; <DATA> }; | ||
|
||
my $doc = Pod::Elemental->read_string($str); | ||
|
||
Pod::Elemental::Transformer::Pod5->new->transform_node($doc); | ||
|
||
my $e = exception { | ||
Pod::Elemental::Transformer::Exec->new->transform_node($doc) | ||
}; | ||
|
||
ok $e, 'correctly got exception'; | ||
like $e, qr/STDOUT: station!/, 'STDOUT included'; | ||
like $e, qr/STDERR: got an error :\(/, 'STDERR included'; | ||
like $e, qr/Command 'perl -E.*' failed/, 'Command included'; | ||
|
||
note "Exception: $e"; | ||
|
||
|
||
done_testing; | ||
|
||
__DATA__ | ||
=pod | ||
=head1 Welcome to Pod! | ||
=for exec | ||
perl -E"say 'station!'; die 'got an error :('" | ||
Right?? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,8 @@ Right?? | |
=cut | ||
POD | ||
|
||
note('POD: ' . $doc->as_pod_string); | ||
|
||
done_testing; | ||
|
||
__DATA__ | ||
|