Skip Menu |

This queue is for tickets about the Test-Expect CPAN distribution.

Report information
The Basics
Id: 35668
Status: resolved
Priority: 0/
Queue: Test-Expect

People
Owner: Nobody in particular
Requestors: cpan [...] chmrr.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Provide a expect_quit method
It is sometimes useful to be able to explicitly direct the Expect::Simple process to quit. Having it run at END {} time means that it is difficult to explicitly order the quitting with, say, the HTTP server which is torn down at END {} time. The attached patch adds an expect_quit method, which does what you'd expect. - Alex, for Best Practical
Subject: expect-quit.patch
diff -ru Test-Expect-0.30/lib/Test/Expect.pm Test-Expect-0.30-patched/lib/Test/Expect.pm --- Test-Expect-0.30/lib/Test/Expect.pm 2006-02-28 17:00:18.000000000 -0500 +++ Test-Expect-0.30-patched/lib/Test/Expect.pm 2008-05-05 18:51:16.000000000 -0400 @@ -14,6 +14,7 @@ expect_is expect_like expect_send +expect_quit expect END ); @@ -83,10 +84,14 @@ expect_is($is, $label); } -sub END { +sub expect_quit { undef $expect; } +sub END { + expect_quit; +} + 1; __END__ @@ -167,6 +172,10 @@ This returns the L<Expect> object. +=head1 expect_quit + +Closes the L<Expect> handle. + =head1 SEE ALSO L<Expect>, L<Expect::Simple>.
Thanks, Test-Expect-0.31.tar.gz just hit CPAN with your patch in it.