From 66eec9a4c63b05dce4963dcdb755e7a50c9b9f0a Mon Sep 17 00:00:00 2001 From: dz-at-tc <49352191+dz-at-tc@users.noreply.github.com> Date: Sat, 10 Oct 2020 20:09:37 -0400 Subject: [PATCH] Convert t/mojo/reactor_detect.t to use subtests --- t/mojo/reactor_detect.t | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/t/mojo/reactor_detect.t b/t/mojo/reactor_detect.t index f90ab083d7..106a991f89 100644 --- a/t/mojo/reactor_detect.t +++ b/t/mojo/reactor_detect.t @@ -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();