Group
Extension

Matches 6

Role-Multiton ( D/DM/DMUEY/Role-Multiton-0.2.tar.gz, DMUEY, 2013; MetaCPAN )
Role-Multiton/t/04.Role-Multiton-New.t ( view source; MetaCPAN )
le::Multiton::New $Role::Multiton::New::VERSION");

my $_x = MyMoo->new();
my $n  = MyMoo->new();
isnt( $_x, $n, 'initially new() gives a different object each time' );

my $_m = MyMoo->new( 'cow' => 
m1, MyMoo->new( { 'cow' => 42 } ), 'new() w/ same args returns same object (args in hashref)' );

isnt( $m1, $no, 'new() w/ different args give different object' );

throws_ok { MyMoo->turn_new_into_m
ect/same class returns the new object' );
is( $n,                           MyMoo->new(), 'new() subsequently returns the new object' );
isnt( $n, $no, 'sanity: new object is not the previous one' );
Role-Multiton ( D/DM/DMUEY/Role-Multiton-0.2.tar.gz, DMUEY, 2013; MetaCPAN )
Role-Multiton/t/07.with-Singleton-then-Multiton.t ( view source; MetaCPAN )
when Role::Singleton is with()d first' );
isnt( $i, $m, 'w/ both roles: instance() when Role::Singleton is with()d first: instance() is not multiton()' );
isnt( $i, $n, 'w/ both roles: instance() when
Role-Multiton ( D/DM/DMUEY/Role-Multiton-0.2.tar.gz, DMUEY, 2013; MetaCPAN )
Role-Multiton/t/03.Role-Singleton.t ( view source; MetaCPAN )
th 'Role::Singleton';

package main;

diag("Testing Role::Singleton $Role::Singleton::VERSION");

isnt( MyMoo->new(), MyMoo->new(), 'new() gives a new object each time' );

my $s = MyMoo->singleton( '
less of args)' );

is( $s, MyMoo->instance(), 'instance() returns same object as singleton()' );

isnt( $s, MyMoo->new(), 'new() still gives a new object even after there is a singleton in the class' 
Role-Multiton ( D/DM/DMUEY/Role-Multiton-0.2.tar.gz, DMUEY, 2013; MetaCPAN )
Role-Multiton/t/06.with-Multiton-then-Singleton.t ( view source; MetaCPAN )
 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 ( D/DM/DMUEY/Role-Multiton-0.2.tar.gz, DMUEY, 2013; MetaCPAN )
Role-Multiton/t/02.Role-Multiton.t ( view source; MetaCPAN )

with 'Role::Multiton';

package main;

diag("Testing Role::Multiton $Role::Multiton::VERSION");

isnt( MyMoo->new(), MyMoo->new(), 'new() gives a new object each time' );

my $m1 = MyMoo->multiton( '
MyMoo->multiton();
is( $m2, MyMoo->instance(), 'instance() returns same object as multiton()' );

isnt( $m1, MyMoo->new( 'cow' => 42 ), 'new() still gives a new object even after there is a multiton i
Role-Multiton ( D/DM/DMUEY/Role-Multiton-0.2.tar.gz, DMUEY, 2013; MetaCPAN )
Role-Multiton/t/05.Role-Singleton-New.t ( view source; MetaCPAN )
le::Singleton::New $Role::Singleton::New::VERSION");

my $o = MyMoo->new();
my $n = MyMoo->new();
isnt( $o, $n, 'initially new() gives a different object each time' );

is( $o->turn_new_into_singleton

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