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' );
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
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'
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
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
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