Immutable fix to work with new Class::MOP, and trailing whitespace fuckup. Doh!
[gitmo/Moose.git] / t / 300_immutable_moose.t
CommitLineData
03aac1fa 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
ac2dc464 6use Test::More tests => 6;
39b3bc94 7use Test::Exception;
8
ac2dc464 9BEGIN {
39b3bc94 10 use_ok('Moose');
ac2dc464 11 use_ok('Moose::Meta::Role');
12}
13
14{
15 package FooRole;
16 our $VERSION = '0.01';
17 sub foo { 'FooRole::foo' }
18 }
19
20{
21 package Foo;
22 use Moose;
23
24}
25
26{
27 my $foo_role = Moose::Meta::Role->initialize('FooRole');
28 my $meta = Foo->meta;
29 lives_ok{ $meta->make_immutable } "Foo is imutable";
30 dies_ok{ $meta->add_role($foo_role) } "Add Role is locked";
31 lives_ok{ $meta->make_mutable } "Foo is mutable";
32 lives_ok{ $meta->add_role($foo_role) } "Add Role is unlocked";
39b3bc94 33}
946289d1 34
35=pod
36
37Nothing here yet, but soon :)
38
39=cut