From: Matt S Trout Date: Fri, 20 Jul 2012 19:22:48 +0000 (+0000) Subject: timeout test X-Git-Tag: v0.002002~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=49e9ae37ca7aec5a02f1112c73feb6001db0e954;p=scpubgit%2FObject-Remote.git timeout test --- diff --git a/Changes b/Changes index be4beb9..9240d01 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,4 @@ + - timeouts for connection setup - support Object::Remote->start::connect - timer support in MiniLoop diff --git a/t/timeout.t b/t/timeout.t new file mode 100644 index 0000000..dba6c62 --- /dev/null +++ b/t/timeout.t @@ -0,0 +1,16 @@ +use strictures 1; +use Test::More; + +use Object::Remote; +use Object::Remote::Connector::Local; + +my $connector = Object::Remote::Connector::Local->new( + timeout => { after => 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;