Skip to content

Commit

Permalink
Merge pull request #1572 from dz-at-tc/add_subtests_to_mojo_reactor_d…
Browse files Browse the repository at this point in the history
…etect_t

Convert t/mojo/reactor_detect.t to use subtests
  • Loading branch information
mergify[bot] authored Oct 11, 2020
2 parents 98fe384 + 66eec9a commit 39989a0
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions t/mojo/reactor_detect.t
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,20 @@ use Mojo::Base 'Mojo::Reactor::Poll';

package main;

# Detection (success)
{
subtest 'Detection (success)' => sub {
local $ENV{MOJO_REACTOR} = 'Mojo::Reactor::Test';
is(Mojo::Reactor->detect, 'Mojo::Reactor::Test', 'right class');
}
};

# Detection (fail)
{
subtest 'Detection (fail)' => sub {
local $ENV{MOJO_REACTOR} = 'Mojo::Reactor::DoesNotExist';
is(Mojo::Reactor->detect, 'Mojo::Reactor::Poll', 'right class');
}
};

# Event loop detection
{
subtest 'Event loop detection' => sub {
local $ENV{MOJO_REACTOR} = 'Mojo::Reactor::Test';
require Mojo::IOLoop;
is ref Mojo::IOLoop->new->reactor, 'Mojo::Reactor::Test', 'right class';
}
};

done_testing();

0 comments on commit 39989a0

Please sign in to comment.