Refactored native trait accessors so they are done entirely in roles.
[gitmo/Moose.git] / t / 070_native_traits / 060_trait_number.t
index cfcd4fe..7eef720 100644 (file)
@@ -3,8 +3,11 @@
 use strict;
 use warnings;
 
+use lib 't/lib';
+
 use Moose ();
 use Moose::Util::TypeConstraints;
+use NoInlineAttribute;
 use Test::Exception;
 use Test::More;
 use Test::Moose;
@@ -34,9 +37,13 @@ use Test::Moose;
             superclasses => ['Moose::Object'],
         );
 
+        my @traits = 'Number';
+        push @traits, 'NoInlineAttribute'
+            if delete $attr{no_inline};
+
         $class->add_attribute(
             integer => (
-                traits  => ['Number'],
+                traits  => \@traits,
                 is      => 'ro',
                 isa     => 'Int',
                 default => 5,
@@ -54,6 +61,7 @@ use Test::Moose;
     run_tests(build_class);
     run_tests( build_class( lazy => 1 ) );
     run_tests( build_class( trigger => sub { } ) );
+    run_tests( build_class( no_inline => 1 ) );
 
     # Will force the inlining code to check the entire hashref when it is modified.
     subtype 'MyInt', as 'Int', where { 1 };