use lib 't/lib', 'lib';
-use Test::More tests => 31;
+use Test::More tests => 32;
use Test::Exception;
{
'Foo::Subclass->meta()->attr2() returns expected value' );
{
+
package Class::WithAlreadyPresentTrait;
use Moose -traits => 'My::SimpleTrait';
- has an_attr => ( is => 'ro' );
+ has an_attr => ( is => 'ro' );
}
+
lives_ok {
- my $instance = Class::WithAlreadyPresentTrait->new(an_attr => 'value');
- is($instance->an_attr, 'value', 'Can get value');
-} 'Can create instance and access attributes';
+ my $instance = Class::WithAlreadyPresentTrait->new( an_attr => 'value' );
+ is( $instance->an_attr, 'value', 'Can get value' );
+}
+'Can create instance and access attributes';
{
+
package Class::WhichLoadsATraitFromDisk;
- use Moose -traits => 'Role::Parent'; # Any role you like here, the only important bit is that it
- # gets loaded from disk and has not already been defined.
-
+
+ # Any role you like here, the only important bit is that it gets
+ # loaded from disk and has not already been defined.
+ use Moose -traits => 'Role::Parent';
+
has an_attr => ( is => 'ro' );
}
-TODO: {
- local $TODO = 'Not working yet';
- lives_ok {
- my $instance = Class::WhichLoadsATraitFromDisk->new(an_attr => 'value');
- is($instance->an_attr, 'value', 'Can get value');
- } 'Can create instance and access attributes';
+lives_ok {
+ my $instance = Class::WhichLoadsATraitFromDisk->new( an_attr => 'value' );
+ is( $instance->an_attr, 'value', 'Can get value' );
}
-
+'Can create instance and access attributes';