Commit | Line | Data |
---|---|---|
95ba4025 | 1 | use strictures; |
2 | ||
3 | use Test::More; | |
4 | ||
5 | use Scalar::Util 'weaken'; | |
6 | use Object::Remote::FromData; | |
7 | ||
8 | my $conn_ref; | |
9 | { | |
10 | my $conn = Object::Remote->connect( '-' ); | |
11 | $conn_ref = \( $conn->{send_to_fh} ); | |
12 | weaken $conn_ref; | |
13 | is My::TestClass->new::on( $conn )->run, 3, "correct output"; | |
14 | } | |
15 | sleep 3; | |
16 | is $$conn_ref, undef, "filehandle to ssh's STDIN is garbage-collected"; | |
17 | ||
18 | done_testing; | |
19 | ||
20 | __DATA__ | |
21 | ||
22 | package My::TestClass; | |
23 | use Moo; | |
24 | sub run { "3" } |