Group
Extension

Role-Multiton/t/06.with-Multiton-then-Singleton.t

use Test::More tests => 3;

package MyMoo;
use Moo;
has cow => ( is => 'rw' );
with 'Role::Multiton';
with 'Role::Singleton';

package main;

my $n = MyMoo->new();
my $s = MyMoo->singleton();
my $m = MyMoo->multiton();
my $i = MyMoo->instance();

is( $i, $m, 'w/ both roles: instance() is multiton() when Role::Multiton is with()d first' );
isnt( $i, $s, 'w/ both roles: instance() when Role::Multiton is with()d first: instance() is not singleton()' );
isnt( $i, $n, 'w/ both roles: instance() when Role::Multiton is with()d first: instance() is not new()' );


Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.