]> git.vpit.fr Git - perl/modules/LaTeX-TikZ.git/blobdiff - t/02-autocoerce.t
Just use Mouse instead of Any::Moose
[perl/modules/LaTeX-TikZ.git] / t / 02-autocoerce.t
index 463614b23ce80b79e95642da2727b0db25dc684d..b171715eda6d219de7714b1d731d00a0ce01a7d8 100644 (file)
@@ -12,42 +12,40 @@ use LaTeX::TikZ::Meta::TypeConstraint::Autocoerce;
 {
  my $tc = eval {
   LaTeX::TikZ::Meta::TypeConstraint::Autocoerce->new(
-   parent => undef,
+   target => undef,
   );
  };
- like $@, qr/^No meta object for undefined parent/, 'Undef parent';
+ like $@, qr/^No meta object for undefined target/, 'Undef target';
 }
 
 {
- my $parent = 'LaTeX::TikZ::A::Class::Likely::Not::To::Exist';
+ my $target = 'LaTeX::TikZ::A::Class::Likely::Not::To::Exist';
  my $tc = eval {
   LaTeX::TikZ::Meta::TypeConstraint::Autocoerce->new(
-   parent => $parent,
+   target => $target,
   );
  };
- like $@, qr/^No meta object for parent \Q$parent\E/, 'Nonexistent parent';
+ like $@, qr/^No meta object for target \Q$target\E/, 'Nonexistent target';
 }
 
 {
  my $tc = eval {
   LaTeX::TikZ::Meta::TypeConstraint::Autocoerce->new(
-   parent => 'LaTeX::TikZ::Meta::TypeConstraint::Autocoerce',
+   target => 'LaTeX::TikZ::Meta::TypeConstraint::Autocoerce',
   );
  };
- is $@, '', 'Valid parent';
+ is $@, '', 'Valid target';
 }
 
 {
  package LaTeX::TikZ::TestX;
 
- use Any::Moose;
- use Any::Moose 'Util::TypeConstraints' => [ qw/
-  coerce
-  from
-  via
+ use Mouse;
+ use Mouse::Util::TypeConstraints qw<
+  coerce from via
   find_type_constraint
   register_type_constraint
/ ];
>;
 
  has 'id' => (
   is       => 'ro',
@@ -58,7 +56,7 @@ use LaTeX::TikZ::Meta::TypeConstraint::Autocoerce;
  register_type_constraint(
   LaTeX::TikZ::Meta::TypeConstraint::Autocoerce->new(
    name   => 'LaTeX::TikZ::TestX::Autocoerce',
-   parent => find_type_constraint(__PACKAGE__),
+   target => find_type_constraint(__PACKAGE__),
    mapper => sub {
     shift;
     my ($last) = $_[0] =~ /::([^:]+)$/;
@@ -83,7 +81,7 @@ use LaTeX::TikZ::Meta::TypeConstraint::Autocoerce;
 {
  package LaTeX::TikZ::TestY;
 
- use Any::Moose;
+ use Mouse;
 
  has 'num' => (
   is       => 'ro',
@@ -99,7 +97,7 @@ use LaTeX::TikZ::Meta::TypeConstraint::Autocoerce;
 {
  package LaTeX::TikZ::TestZ;
 
- use Any::Moose;
+ use Mouse;
 
  has 'x' => (
   is       => 'ro',
@@ -116,8 +114,8 @@ use LaTeX::TikZ::Meta::TypeConstraint::Autocoerce;
 {
  package LaTeX::TikZ::TestW;
 
- use Any::Moose;
- use Any::Moose 'Util::TypeConstraints';
+ use Mouse;
+ use Mouse::Util::TypeConstraints;
 
  has 'x' => (
   is       => 'ro',
@@ -126,7 +124,7 @@ use LaTeX::TikZ::Meta::TypeConstraint::Autocoerce;
  );
 
  coerce 'LaTeX::TikZ::TestX::Autocoerce'
-     => from __PACKAGE__
+     => from +(__PACKAGE__)
      => via { $_->x };
 
  __PACKAGE__->meta->make_immutable;