Skip to content

Commit 887f80f

Browse files
committed
t: Condense variable assignment with ok-check
1 parent 28fdacc commit 887f80f

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

t/api/03-auth.t

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,13 @@ my $mock_asset = Test::MockModule->new('OpenQA::Schema::Result::Assets');
3636
$mock_asset->redefine(remove_from_disk => sub { $mock_asset_remove_callcount++; return 1; });
3737

3838
subtest 'authentication routes for plugins' => sub {
39-
my $public = $t->app->routes->find('api_public');
40-
ok $public, 'api_pubic route found';
39+
ok my $public = $t->app->routes->find('api_public'), 'api_pubic route found';
4140
$public->put('/public_plugin' => sub { shift->render(text => 'API public plugin works!') });
42-
my $ensure_user = $t->app->routes->find('api_ensure_user');
43-
ok $ensure_user, 'api_ensure_user route found';
41+
ok my $ensure_user = $t->app->routes->find('api_ensure_user'), 'api_ensure_user route found';
4442
$ensure_user->put('/user_plugin' => sub { shift->render(text => 'API user plugin works!') });
45-
my $ensure_admin = $t->app->routes->find('api_ensure_admin');
46-
ok $ensure_admin, 'api_ensure_admin route found';
43+
ok my $ensure_admin = $t->app->routes->find('api_ensure_admin'), 'api_ensure_admin route found';
4744
$ensure_admin->put('/admin_plugin' => sub { shift->render(text => 'API admin plugin works!') });
48-
my $ensure_operator = $t->app->routes->find('api_ensure_operator');
49-
ok $ensure_operator, 'api_ensure_operator route found';
45+
ok my $ensure_operator = $t->app->routes->find('api_ensure_operator'), 'api_ensure_operator route found';
5046
$ensure_operator->put('/operator_plugin' => sub { shift->render(text => 'API operator plugin works!') });
5147
};
5248

0 commit comments

Comments
 (0)