not have an other_fail attr');
isnt(Foo->meta->get_attribute('foo'),
Bar->meta->get_attribute('foo'),
'... Foo and Bar have different copies of foo');
isnt(Foo->meta->get_attribute('bar'),
have different copies of bar');
isnt(Foo->meta->get_attribute('baz'),
Bar->meta->get_attribute('baz'),
'... Foo and Bar have different copies of baz');
isnt(Foo->meta->get_attribute('gorch'
different copies of gorch');
isnt(Foo->meta->get_attribute('gloum'),
Bar->meta->get_attribute('gloum'),
'... Foo and Bar have different copies of gloum');
isnt(Foo->meta->get_attribute('bli
s $pawn, $pawn;
my $king = $meta->get_method('king');
isnt $pawn, $king;
$meta->add_method(king => sub{ 'fool' });
isnt $king, $meta->get_method('king');
};
is( join(' ', sort $meta
for the metaclass");
my $child_meta = Child->meta;
isa_ok($child_meta, 'Mouse::Meta::Class');
isnt($meta, $child_meta, "different metaclass instances for the two classes");
is_deeply([$child_meta
=> 'text/plain' } );
my $header2 = $r->headers;
isa_ok( $header2, 'HTTP::Headers' );
isnt( $header, $header2, '... created a new HTTP::Header object' );
is( $header2->content_type, '
=> 'text/html' ] );
my $header3 = $r->headers;
isa_ok( $header3, 'HTTP::Headers' );
isnt( $header2, $header3, '... created a new HTTP::Header object' );
is( $header3->content_type,
pplication/pdf' ) );
my $header4 = $r->headers;
isa_ok( $header4, 'HTTP::Headers' );
isnt( $header3, $header4, '... created a new HTTP::Header object' );
is( $header4->content_type,
Bling;
use Mouse;
::isnt( ::exception {
has('bling' => (is => 'rw', trigger => 'Fail'));
}, undef, '... a trigger must be a CODE ref' );
::isnt( ::exception {
has('b
ss->does('Bark'), '... the class does not do the Bark role');
isa_ok($obj, 'My::Class');
isnt(blessed($obj), 'My::Class', '... but it is no longer blessed into My::Class');
ok(!My::Class
e too');
ok(!My::Class->does('Sleeper'), '... the class does not do the Sleeper role');
isnt(blessed($obj), blessed($obj2), '... they no longer share the same anon-class/role thing');
i
does('Bark'), '... the class does not do the Bark role');
isa_ok($obj, 'My::Class');
isnt(blessed($obj), 'My::Class', '... but it is no longer blessed into My::Class');
ok(!My::Class
ok(!My::Class->does('Sleeper'), '... the class does not do the Sleeper role');
isnt(blessed($obj), blessed($obj2), '... they no longer share the same anon-class/role thing');
reate_anon_class(
superclasses => ['Class'],
roles => ['Foo'],
);
isnt $class_and_foo_1->name, $class_and_foo_2->name,
'creating the same class twice without cach
uperclasses => ['Class'],
roles => ['Bar'],
cache => 1,
);
isnt $class_and_foo_1->name, $class_and_bar,
'class_and_foo and class_and_bar are different';
ent and child have the same last name ('
. $parent->last_name
. ')' );
}
isnt( $orphan->last_name, $parent->last_name,
'... the orphan child does not have the same l
ent and child have the same last name ('
. $parent->last_name
. ')' );
}
isnt( $orphan->last_name, $parent->last_name,
'... the orphan child is not affected by changes in
ent and child have the same last name ('
. $parent->last_name
. ')' );
}
isnt( $orphan->last_name, $parent->last_name,
'... the orphan child does not have the same l
ent and child have the same last name ('
. $parent->last_name
. ')' );
}
isnt( $orphan->last_name, $parent->last_name,
'... the orphan child is not affected by changes in
lass(cache => 1);
$anon_pkg2 = $anon2->name;
ok($anon2->is_anon_class);
isnt $meta, $anon2;
isnt $meta->name, $anon2->name;
}
# all the stuff are removed?
ok !$anon_pkg1->isa('Mouse
'method from role has correct name in caller()');
}
isnt(MyClass1->foo, "MyClass2::foo", "role method is not confused with other class" );
isnt(MyClass2->foo, "MyClass1::foo", "role method is not c
extends 'Class';
};
my $child_meta = Child->meta;
isa_ok($child_meta, 'Mouse::Meta::Class');
isnt($meta, $child_meta, "different metaclass instances for the two classes");
is_deeply([$child_meta
se::Meta::Class' );
can_ok( 'Point3D', 'meta' );
isa_ok( Point3D->meta, 'Mouse::Meta::Class' );
isnt( Point->meta, Point3D->meta,
'... they are different metaclasses as well' );
# poke at Point
val{ $o->foo($x) }, 10)
or diag("Error: $@");
ts_init($x, 'foo');
eval{
$o->bar($x);
};
isnt $@, '';
ts_init $x, 42;
is(eval{ $o->bar($x) }, 42)
or diag("Error: $@");
$o = eval{
ts
'Mouse::Meta::Class');
can_ok('Point3D', 'meta');
isa_ok(Point3D->meta, 'Mouse::Meta::Class');
isnt(Point->meta, Point3D->meta, '... they are different metaclasses as well');
# poke at Point
is_d