https://github.com/elcamlost/test2-mojox
https://github.com/elcamlost/test2-mojox
mojolicious test2
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/elcamlost/test2-mojox
- Owner: elcamlost
- License: artistic-2.0
- Created: 2019-08-27T17:04:52.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-04-13T08:07:53.000Z (about 3 years ago)
- Last Synced: 2025-10-22T08:01:59.436Z (8 months ago)
- Topics: mojolicious, test2
- Language: Perl
- Size: 73.2 KB
- Stars: 0
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
# Test2::MojoX [](https://travis-ci.com/elcamlost/Test2-MojoX) [](https://coveralls.io/github/elcamlost/Test2-MojoX)
Testing Mojo with Test2
```perl
use Test2::V0;
use Test2::MojoX;
use Mojolicious::Lite -signatures;
get '/' => sub {
shift->render(
json => {
scalar => 'value',
array => [qw/item1 item2/],
hash => {key1 => 'value1', key2 => 'value2'}
}
);
};
my $t = Test2::MojoX->new;
$t->get_ok('/')->json_is(hash {
field scalar => 'value';
field array => array {
item 'item1';
item 'item2';
end;
};
field hash => hash {
field key1 => 'value1';
field key2 => 'value2';
end;
};
end;
});
```
## Installation
Module available at [CPAN](https://metacpan.org/pod/Test2::MojoX). So you can install with your favourite cpan installer, such as cpan, carton, carmel etc.