Regenerate test files
[gitmo/Mouse.git] / t / 030_roles / 034_create_role.t
CommitLineData
7a50b450 1#!/usr/bin/env perl
fde8e43f 2# This is automatically generated by author/import-moose-test.pl.
3# DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
4use t::lib::MooseCompat;
7a50b450 5use strict;
6use warnings;
fde8e43f 7use Test::More;
8use Mouse ();
7a50b450 9
10my $role = Mouse::Meta::Role->create(
11 'MyItem::Role::Equipment',
12 attributes => {
13 is_worn => {
14 is => 'rw',
15 isa => 'Bool',
16 },
17 },
18 methods => {
19 remove => sub { shift->is_worn(0) },
20 },
21);
22
23my $class = Mouse::Meta::Class->create('MyItem::Armor::Helmet' =>
24 roles => ['MyItem::Role::Equipment'],
25);
26
27my $visored = $class->new_object(is_worn => 0);
28ok(!$visored->is_worn, "attribute, accessor was consumed");
29$visored->is_worn(1);
30ok($visored->is_worn, "accessor was consumed");
31$visored->remove;
32ok(!$visored->is_worn, "method was consumed");
33
34ok(!$role->is_anon_role, "the role is not anonymous");
35
fde8e43f 36done_testing;