1#!/usr/bin/perl -w
2
3use strict;
4use Test::More 'no_plan';
5use Test::Fatal;
6$| = 1;
7
8
9
10# =begin testing SETUP
11BEGIN {
12  package MyApp::Meta::Class::Trait::HasTable;
13  use Moose::Role;
14  Moose::Util::meta_class_alias('HasTable');
15
16  has table => (
17      is  => 'rw',
18      isa => 'Str',
19  );
20}
21
22
23
24# =begin testing SETUP
25{
26
27  # in lib/MyApp/Meta/Class/Trait/HasTable.pm
28  package MyApp::Meta::Class::Trait::HasTable;
29  use Moose::Role;
30  Moose::Util::meta_class_alias('HasTable');
31
32  has table => (
33      is  => 'rw',
34      isa => 'Str',
35  );
36
37  # in lib/MyApp/User.pm
38  package MyApp::User;
39  use Moose -traits => 'HasTable';
40
41  __PACKAGE__->meta->table('User');
42}
43
44
45
46# =begin testing
47{
48can_ok( MyApp::User->meta, 'table' );
49is( MyApp::User->meta->table, 'User', 'My::User table is User' );
50}
51
52
53
54
551;
56