[libtype-tiny-perl] 10/46: get test suite passing on Moose 2.0007

Jonas Smedegaard dr at jones.dk
Fri Sep 12 18:48:02 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 1.001_000
in repository libtype-tiny-perl.

commit af0b9cd515b967956c83f8f9264112abba7c73f5
Author: Toby Inkster <mail at tobyinkster.co.uk>
Date:   Thu Aug 28 09:22:17 2014 +0100

    get test suite passing on Moose 2.0007
---
 lib/Types/TypeTiny.pm                            |  2 +-
 t/02-api.t                                       |  2 --
 t/30-integration/Moose/basic.t                   |  1 +
 t/30-integration/Moose/coercion.t                | 18 ++++--------------
 t/30-integration/Moose/inflate-then-inline.t     |  6 +++---
 t/30-integration/Moose/native-attribute-traits.t |  4 ++--
 6 files changed, 11 insertions(+), 22 deletions(-)

diff --git a/lib/Types/TypeTiny.pm b/lib/Types/TypeTiny.pm
index e7de8b8..f192b80 100644
--- a/lib/Types/TypeTiny.pm
+++ b/lib/Types/TypeTiny.pm
@@ -170,7 +170,7 @@ sub _TypeTinyFromMoose
 	$opts{display_name} = $t->name;
 	$opts{constraint}   = $t->constraint;
 	$opts{parent}       = to_TypeTiny($t->parent)              if $t->has_parent;
-	$opts{inlined}      = sub { shift; $t->_inline_check(@_) } if $t->can_be_inlined;
+	$opts{inlined}      = sub { shift; $t->_inline_check(@_) } if $t->can("can_be_inlined") && $t->can_be_inlined;
 	$opts{message}      = sub { $t->get_message($_) }          if $t->has_message;
 	$opts{moose_type}   = $t;
 	
diff --git a/t/02-api.t b/t/02-api.t
index 576026f..433c303 100644
--- a/t/02-api.t
+++ b/t/02-api.t
@@ -34,9 +34,7 @@ my @MOOSE_WANTS = qw(
 	_compiled_type_constraint
 	_default_message
 	_has_compiled_type_constraint
-	_has_inlined_type_constraint
 	_inline_check
-	_inline_environment
 	_new
 	_package_defined_in
 	_set_constraint
diff --git a/t/30-integration/Moose/basic.t b/t/30-integration/Moose/basic.t
index bc6ef4f..7fae7a2 100644
--- a/t/30-integration/Moose/basic.t
+++ b/t/30-integration/Moose/basic.t
@@ -28,6 +28,7 @@ the same terms as the Perl 5 programming language system itself.
 
 use strict;
 use warnings;
+no warnings qw(once);
 use lib qw( ./lib ./t/lib ../inc ./inc );
 
 use Test::More;
diff --git a/t/30-integration/Moose/coercion.t b/t/30-integration/Moose/coercion.t
index 5d62f0a..ddda7de 100644
--- a/t/30-integration/Moose/coercion.t
+++ b/t/30-integration/Moose/coercion.t
@@ -10,7 +10,7 @@ Check coercions work with L<Moose>; both mutable and immutable classes.
 
 Uses the bundled BiggerLib.pm type library.
 
-Test is skipped if Moose 2.1200 is not available.
+Test is skipped if Moose 2.0000 is not available.
 
 =head1 AUTHOR
 
@@ -30,11 +30,12 @@ use warnings;
 use lib qw( ./lib ./t/lib ../inc ./inc );
 
 use Test::More;
-use Test::Requires { Moose => '2.1200' };
+use Test::Requires { Moose => '2.0000' };
 use Test::Fatal;
 use Test::TypeTiny qw( matchfor );
 
 my $e;
+my $o;
 
 {
 	package Local::Class;
@@ -47,20 +48,9 @@ my $e;
 	has small  => (is => "rw", isa => SmallInteger, coerce => 1);
 	has big    => (is => "rw", isa => BigInteger, coerce => 1);
 	
-	$e = ::exception {
-		has big_nc => (is => "rw", isa => BigInteger->no_coercions, coerce => 1);
-	};
+	has big_nc => (is => "rw", isa => BigInteger->no_coercions, coerce => 0);
 }
 
-like(
-	$e,
-	qr{^You cannot coerce an attribute .?big_nc.? unless its type .?\w+.? has a coercion},
-	"no_coercions and friends available on Moose type constraint objects",
-);
-
-undef $e;
-my $o;
-
 my $suffix = "mutable class";
 for my $i (0..1)
 {
diff --git a/t/30-integration/Moose/inflate-then-inline.t b/t/30-integration/Moose/inflate-then-inline.t
index f575387..ab5116f 100644
--- a/t/30-integration/Moose/inflate-then-inline.t
+++ b/t/30-integration/Moose/inflate-then-inline.t
@@ -10,7 +10,7 @@ L<Moose::Meta::TypeConstraint> objects.
 
 =head1 DEPENDENCIES
 
-Test is skipped if Moose 2.0600 is not available.
+Test is skipped if Moose 2.0000 is not available.
 
 =head1 AUTHOR
 
@@ -28,7 +28,7 @@ the same terms as the Perl 5 programming language system itself.
 use strict;
 use warnings;
 use Test::More 0.96;
-use Test::Requires { 'Moose' => '2.0600' };
+use Test::Requires { 'Moose' => '2.0000' };
 
 use Type::Tiny;
 
@@ -51,6 +51,6 @@ like(
 	$type2->moose_type->_inline_check('$XXX'),
 	qr/\(\(?!!1\)? && !!2\)/,
 	'$type2->moose_type->_inline_check'
-);
+) if $type2->moose_type->can("_inline_check");
 
 done_testing;
diff --git a/t/30-integration/Moose/native-attribute-traits.t b/t/30-integration/Moose/native-attribute-traits.t
index 8759cea..c1d4d11 100644
--- a/t/30-integration/Moose/native-attribute-traits.t
+++ b/t/30-integration/Moose/native-attribute-traits.t
@@ -9,7 +9,7 @@ traits.
 
 =head1 DEPENDENCIES
 
-Test is skipped if Moose 2.0600 is not available.
+Test is skipped if Moose 2.0000 is not available.
 
 =head1 AUTHOR
 
@@ -25,7 +25,7 @@ the same terms as the Perl 5 programming language system itself.
 =cut
 
 use Test::More;
-use Test::Requires { Moose => '2.0600' };
+use Test::Requires { Moose => '2.0000' };
 use Test::Fatal;
 use Test::TypeTiny qw( matchfor );
 use Test::Moose qw( with_immutable );

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libtype-tiny-perl.git



More information about the Pkg-perl-cvs-commits mailing list