refactor load_first_existing_class
[gitmo/Class-MOP.git] / t / 314_class_is_pristine.t
1 use strict;
2 use warnings;
3
4 use Class::MOP;
5
6 use Test::More tests => 3;
7
8 {
9     package Foo;
10
11     sub foo { }
12     sub bar { }
13 }
14
15 my $meta = Class::MOP::Class->initialize('Foo');
16 ok( $meta->is_pristine, 'Foo is still pristine' );
17
18 $meta->add_method( baz => sub { } );
19 ok( $meta->is_pristine, 'Foo is still pristine after add_method' );
20
21 $meta->add_attribute( name => 'attr', reader => 'get_attr' );
22 ok( ! $meta->is_pristine, 'Foo is not pristine after add_attribute' );