Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert t/mojo/signatures.t to use subtests #1571

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions t/mojo/signatures.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,19 @@ sub foo ($self, $bar, $baz) { $bar - $baz }

package main;

# Basics
my $test = MojoSignatureBaseTest->new;
is($test->foo(23, 24), 47, 'right result');

# Random order flags
my $test2 = MojoSignatureBaseTest2->new;
is($test2->foo(26, 24), 2, 'right result');

# Bad flag
eval "package MojoSignaturesTest3; use Mojo::Base -unsupported";
like $@, qr/Unsupported flag: -unsupported/, 'right error';
subtest 'Basics' => sub {
my $test = MojoSignatureBaseTest->new;
is($test->foo(23, 24), 47, 'right result');
};

subtest 'Random order flags' => sub {
my $test2 = MojoSignatureBaseTest2->new;
is($test2->foo(26, 24), 2, 'right result');
};

subtest 'Bad flag' => sub {
eval "package MojoSignaturesTest3; use Mojo::Base -unsupported";
like $@, qr/Unsupported flag: -unsupported/, 'right error';
};

done_testing();