This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
requires Minion => '== 10.13'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Test2::V0; | |
use File::Temp; | |
use Redis; | |
use Test::RedisServer; | |
my $test_server = Test::RedisServer->new( | |
tmpdir => File::Temp->newdir( CLEANUP => 1, DIR => '.' ), | |
conf => { port => 9000 }, | |
) || bail_out('Failed to start test redis server'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Test2::V0; | |
subtest 'Overriding "isa" on a mock object' => sub { | |
isa_ok( | |
mock( {}, override => [ isa => sub { pop eq 'Foo' } ] ), | |
['Foo'], | |
'should correctly respond to "isa"', | |
); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Test2::V0; | |
subtest 'Given a class with attribute: Maybe[`a]' => sub { | |
package Job { | |
use Moo; | |
use Types::Standard qw< :types >; | |
has title => ( is => 'ro', isa => Str ); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package PwC; | |
use 5.032; | |
use Moo; | |
use SOAP::Data::Builder::Simple qw< data >; | |
use Type::Params qw< Invocant compile >; | |
use Type::Utils qw< class_type >; | |
use Types::Standard qw< ArrayRef >; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Service; | |
use Moo; | |
use Type::Utils qw( class_type ); | |
use Types::Standard qw( Str ); | |
use URI; | |
has endpoint => ( | |
coerce => 1, | |
default => 'https://example.com/service', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Foo; | |
use Type::Library -base; | |
use Type::Utils qw( as declare ); | |
use Types::Standard qw( Dict HashRef Int slurpy ); | |
declare Params, as Dict[ id => Int, slurpy HashRef ]; | |
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Test2::V0; | |
package Controller { | |
use 5.030; | |
use Moo; | |
use Type::Params qw< Invocant compile >; | |
use Type::Utils qw< declare as where >; | |
use Types::Standard qw< :types >; | |
my $Controller = declare as Object, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Test2::V0; | |
use Test::LectroTest::Compat; | |
use Test::LectroTest::Generator qw< :all >; | |
sub Positive_Int { | |
Gen { abs Int->generate(@_) } | |
} | |
holds( | |
Property { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Test2::V0; | |
use MooseX::Test::Role; | |
package Temporal { | |
use Moo::Role; | |
use Types::Standard ':all'; | |
requires 'created_at'; | |
around created_at => sub { |