Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

better cleanup tests

  • Loading branch information...
commit 4fa29b3c6da2aa09c1f02cd2555057e3ac39d3eb 1 parent 008a388
@kraih authored
View
3  Changes
@@ -1,4 +1,7 @@
+3.26 2012-08-09
+ - Improved tests.
+
3.25 2012-08-08
- Improved documentation.
- Fixed cleanup bugs in Mojo::Server::Daemon and Mojo::UserAgent.
View
2  lib/Mojolicious.pm
@@ -38,7 +38,7 @@ has static => sub { Mojolicious::Static->new };
has types => sub { Mojolicious::Types->new };
our $CODENAME = 'Rainbow';
-our $VERSION = '3.25';
+our $VERSION = '3.26';
# "These old doomsday devices are dangerously unstable.
# I'll rest easier not knowing where they are."
View
4 t/mojo/reactor_ev.t
@@ -7,7 +7,7 @@ use Test::More;
plan skip_all => 'set TEST_EV to enable this test (developer only!)'
unless $ENV{TEST_EV};
plan skip_all => 'EV 4.0 required for this test!' unless eval 'use EV 4.0; 1';
-plan tests => 68;
+plan tests => 69;
# "Oh well. At least we'll die doing what we love: inhaling molten rock."
use IO::Socket::INET;
@@ -29,7 +29,9 @@ my $triggered;
Mojo::IOLoop->timer(0.25 => sub { $triggered++ });
Mojo::IOLoop->start;
ok $triggered, 'reactor waited for one event';
+my $time = time;
Mojo::IOLoop->start;
+ok time < ($time + 3), 'stopped automatically';
# Listen
my $port = Mojo::IOLoop->generate_port;
View
4 t/mojo/reactor_poll.t
@@ -6,7 +6,7 @@ BEGIN {
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
}
-use Test::More tests => 67;
+use Test::More tests => 68;
# "I don't mind being called a liar when I'm lying, or about to lie,
# or just finished lying, but NOT WHEN I'M TELLING THE TRUTH."
@@ -29,7 +29,9 @@ my $triggered;
Mojo::IOLoop->timer(0.25 => sub { $triggered++ });
Mojo::IOLoop->start;
ok $triggered, 'reactor waited for one event';
+my $time = time;
Mojo::IOLoop->start;
+ok time < ($time + 3), 'stopped automatically';
# Listen
my $port = Mojo::IOLoop->generate_port;
View
4 t/mojo/user_agent.t
@@ -6,7 +6,7 @@ BEGIN {
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
}
-use Test::More tests => 102;
+use Test::More tests => 103;
# "The strong must protect the sweet."
use Mojo::IOLoop;
@@ -131,7 +131,9 @@ is $get, 'Premature connection close', 'right error';
is $post, 'Premature connection close', 'right error';
# Make sure event loop is clean and stops automatically
+my $time = time;
Mojo::IOLoop->start;
+ok time < ($time + 3), 'stopped automatically';
# GET / (non-blocking)
$ua = Mojo::UserAgent->new(ioloop => Mojo::IOLoop->singleton);
Please sign in to comment.
Something went wrong with that request. Please try again.