move repository to http://github.com/moose/MooseX-AlwaysCoerce
[gitmo/MooseX-AlwaysCoerce.git] / t / 03-roles.t
index 271e79f..39f5b87 100644 (file)
@@ -1,10 +1,9 @@
-#!/usr/bin/env perl
 use strict;
 use warnings;
 
-use Test::More tests => 15;
+use Test::More;
 use Test::Fatal;
-use Test::NoWarnings;
+use if $ENV{AUTHOR_TESTING}, 'Test::Warnings';
 
 {
     package MyRole;
@@ -43,12 +42,12 @@ use Test::NoWarnings;
 ok( (my $instance = MyClass->new), 'instance' );
 
 {
-    local $TODO = 'waiting on Moose changes for role support';
+    local $TODO = (Moose->VERSION < 1.9900 ? 'waiting on Moose changes for role support' : undef);
 
     is( exception {
         $instance->foo('bar');
-        is $instance->foo, 3;
     }, undef, 'attribute coercion ran' );
+    is($instance->foo, 3);
 }
 
 is( exception {
@@ -79,3 +78,5 @@ is( exception {
     $instance->untyped_class_attr(10);
     is $instance->untyped_class_attr, 10;
 }, undef, 'set untyped class attribute' );
+
+done_testing;