1Test::Alien::Run(3) User Contributed Perl Documentation Test::Alien::Run(3)
2
3
4
6 Test::Alien::Run - Run object
7
9 version 0.15
10
12 use Test2::Extended::Bundle;
13 use Test::Alien;
14
15 run_ok([ $^X, -e => 'print "some output"; exit 22'])
16 ->exit_is(22)
17 ->out_like(qr{some});
18
20 This class stores information about a process run as performed by
21 Test::Alien#run_ok. That function is the ONLY way to create an
22 instance of this class.
23
25 out
26 my $str = $run->out;
27
28 The standard output from the run.
29
30 err
31 my $str = $run->err;
32
33 The standard error from the run.
34
35 exit
36 my $int = $run->exit;
37
38 The exit value of the run.
39
40 signal
41 my $int = $run->signal;
42
43 The signal that killed the run, or zero if the process was terminated
44 normally.
45
47 These methods return the run object itself, so they can be chained, as
48 in the synopsis above.
49
50 success
51 $run->success;
52 $run->success($message);
53
54 Passes if the process terminated normally with an exit value of 0.
55
56 exit_is
57 $run->exit_is($exit);
58 $run->exit_is($exit, $message);
59
60 Passes if the process terminated with the given exit value.
61
62 exit_isnt
63 $run->exit_isnt($exit);
64 $run->exit_isnt($exit, $message);
65
66 Passes if the process terminated with an exit value of anything but the
67 given value.
68
69 out_like
70 $run->out_like($regex);
71 $run->out_like($regex, $message);
72
73 Passes if the output of the run matches the given pattern.
74
75 out_unlike
76 $run->out_unlike($regex);
77 $run->out_unlike($regex, $message);
78
79 Passes if the output of the run does not match the given pattern.
80
81 err_like
82 $run->err_like($regex);
83 $run->err_like($regex, $message);
84
85 Passes if the standard error of the run matches the given pattern.
86
87 err_unlike
88 $run->err_unlike($regex);
89 $run->err_unlike($regex, $message);
90
91 Passes if the standard error of the run does not match the given
92 pattern.
93
94 note
95 $run->note;
96
97 Send the output and standard error as test note.
98
99 diag
100 $run->diag;
101
102 Send the output and standard error as test diagnostic.
103
105 Test::Alien
106
108 Graham Ollis <plicease@cpan.org>
109
111 This software is copyright (c) 2015 by Graham Ollis.
112
113 This is free software; you can redistribute it and/or modify it under
114 the same terms as the Perl 5 programming language system itself.
115
116
117
118perl v5.30.1 2020-01-30 Test::Alien::Run(3)