File: timeout.t

package info (click to toggle)
libobject-remote-perl 0.003004-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 408 kB
  • ctags: 221
  • sloc: perl: 2,365; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 391 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use strictures 1;
use Test::More;

$ENV{OBJECT_REMOTE_TEST_LOGGER} = 1;

use Object::Remote;
use Object::Remote::Connector::Local;

my $connector = Object::Remote::Connector::Local->new(
  timeout => 0.1,
  perl_command => [ 'perl', '-e', 'sleep 3' ],
);

ok(!eval { $connector->connect; 1 }, 'Connection failed');

like($@, qr{timed out}, 'Connection failed with time out');

done_testing;