Skip all failing tests with Moose 1.05+
[gitmo/Moose-Policy.git] / t / 001_basic.t
index d5f7fc5..f83967a 100644 (file)
@@ -3,9 +3,16 @@
 use strict;
 use warnings;
 
-use Test::More 'no_plan';
+use Test::More;
 
 BEGIN {
+    require Moose;
+
+    plan skip_all => 'Moose::Policy does not work with recent versions of Moose'
+        if Moose->VERSION >= 1.05;
+
+    plan tests => 11;
+
     use_ok('Moose::Policy');
 }
 
@@ -17,7 +24,7 @@ BEGIN {
 
     # this method (mostly stolen from M::M::Attribute) just rebuilds the
     # options so anything with 'is' gets PBP accessors
-    sub _process_options {
+    before '_process_options' => sub {
         my ($class, $name, $options) = @_;
         if (exists $options->{is}) {
             if ($options->{is} eq 'ro') {
@@ -62,6 +69,7 @@ can_ok($foo, 'get_bar');
 can_ok($foo, 'set_bar');
 
 can_ok($foo, 'get_baz');
+ok(! $foo->can('set_baz'), 'without setter');
 
 is($foo->get_bar, 'Foo::bar', '... got the right default value');
 is($foo->get_baz, 'Foo::baz', '... got the right default value');