Moosified
[gitmo/MooseX-Types.git] / t / lib / TestWrapper.pm
index 187e1b5..7a142a4 100644 (file)
@@ -1,36 +1,58 @@
 package TestWrapper;
-use strict;
-use warnings;
+use Moose;
 
-use Class::C3;
-use base 'MooseX::TypeLibrary::Wrapper';
+extends 'MooseX::TypeLibrary::Wrapper';
+#use Class::C3;
+#use base 'MooseX::TypeLibrary::Wrapper';
 
-sub type_export_generator {
-    my $class = shift;
-    my ($type, $full) = @_;
-    my $code = $class->next::method(@_);
+around type_export_generator => sub {
+    my $code = super();
     return sub { $code->(@_) };
-}
+};
 
-sub check_export_generator {
-    my $class = shift;
-    my ($type, $full, $undef_msg) = @_;
-    my $code = $class->next::method(@_);
+#sub type_export_generator {
+#    my $class = shift;
+#    my ($type, $full) = @_;
+#    my $code = $class->next::method(@_);
+#    return sub { $code->(@_) };
+#}
+
+around check_export_generator => sub {
+    my $code = super();
     return sub {
         return $code unless @_;
         return $code->(@_);
     };
-}
+};
+
+#sub check_export_generator {
+#    my $class = shift;
+#    my ($type, $full, $undef_msg) = @_;
+#    my $code = $class->next::method(@_);
+#    return sub {
+#        return $code unless @_;
+#        return $code->(@_);
+#    };
+#}
 
-sub coercion_export_generator {
-    my $class = shift;
-    my ($type, $full, $undef_msg) = @_;
-    my $code = $class->next::method(@_);
+around coercion_export_generator => sub {
+    my $code = super();
     return sub {
-        my $val = $code->(@_);
-        die "coercion returned undef\n" unless defined $val;
-        return $val;
+        my $value = $code->(@_);
+        die "coercion returned undef\n" unless defined $value;
+        return $value;
     };
-}
+};
+
+#sub coercion_export_generator {
+#    my $class = shift;
+#    my ($type, $full, $undef_msg) = @_;
+#    my $code = $class->next::method(@_);
+#    return sub {
+#        my $val = $code->(@_);
+#        die "coercion returned undef\n" unless defined $val;
+#        return $val;
+#    };
+#}
 
 1;