[Moose-commits] r7146 - in Mouse/trunk: . t/800_shikabased
sartak at code2.0beta.co.uk
sartak at code2.0beta.co.uk
Mon Dec 22 02:40:16 GMT 2008
Author: sartak
Date: 2008-12-21 18:40:16 -0800 (Sun, 21 Dec 2008)
New Revision: 7146
Modified:
Mouse/trunk/
Mouse/trunk/t/800_shikabased/002-coerce_multi_class.t
Mouse/trunk/t/800_shikabased/009-overwrite-builtin-subtype.t
Mouse/trunk/t/800_shikabased/010-isa-or.t
Mouse/trunk/t/800_shikabased/014-subtype-as.t
Mouse/trunk/t/800_shikabased/801-mousex_types.t
Mouse/trunk/t/800_shikabased/802-mousex_types-isa-or.t
Log:
r77739 at onn: sartak | 2008-12-21 21:40:05 -0500
More uses of type in the tests
Property changes on: Mouse/trunk
___________________________________________________________________
Name: svk:merge
- 08e7d58d-de06-4458-8c15-335e402ab116:/local/Mouse:77737
08e7d58d-de06-4458-8c15-335e402ab116:/local/Mouse-trunk:61565
3efe9002-19ed-0310-8735-a98156148065:/Mouse/branches/shika-based:6997
+ 08e7d58d-de06-4458-8c15-335e402ab116:/local/Mouse:77739
08e7d58d-de06-4458-8c15-335e402ab116:/local/Mouse-trunk:61565
3efe9002-19ed-0310-8735-a98156148065:/Mouse/branches/shika-based:6997
Modified: Mouse/trunk/t/800_shikabased/002-coerce_multi_class.t
===================================================================
--- Mouse/trunk/t/800_shikabased/002-coerce_multi_class.t 2008-12-22 02:36:38 UTC (rev 7145)
+++ Mouse/trunk/t/800_shikabased/002-coerce_multi_class.t 2008-12-22 02:40:16 UTC (rev 7146)
@@ -18,7 +18,7 @@
use Mouse;
use Mouse::Util::TypeConstraints;
- subtype 'Headers' => where { defined $_ && eval { $_->isa('Response::Headers') } };
+ type 'Headers' => where { defined $_ && eval { $_->isa('Response::Headers') } };
coerce 'Headers' =>
from 'HashRef' => via {
Response::Headers->new(%{ $_ });
@@ -36,7 +36,7 @@
package Request;
use Mouse::Util::TypeConstraints;
- subtype 'Headers' => where { defined $_ && eval { $_->isa('Request::Headers') } };
+ type 'Headers' => where { defined $_ && eval { $_->isa('Request::Headers') } };
};
like $@, qr/The type constraint 'Headers' has already been created, cannot be created again in Request/;
@@ -90,7 +90,7 @@
eval {
package Response;
- subtype 'Headers' => where { defined $_ && eval { $_->isa('Response::Headers') } };
+ type 'Headers' => where { defined $_ && eval { $_->isa('Response::Headers') } };
};
like $@, qr/The type constraint 'Headers' has already been created, cannot be created again in Response/;
Modified: Mouse/trunk/t/800_shikabased/009-overwrite-builtin-subtype.t
===================================================================
--- Mouse/trunk/t/800_shikabased/009-overwrite-builtin-subtype.t 2008-12-22 02:36:38 UTC (rev 7145)
+++ Mouse/trunk/t/800_shikabased/009-overwrite-builtin-subtype.t 2008-12-22 02:40:16 UTC (rev 7146)
@@ -6,6 +6,6 @@
package Request;
use Mouse::Util::TypeConstraints;
- subtype 'Int' => where { 1};
+ type 'Int' => where { 1};
};
like $@, qr/The type constraint 'Int' has already been created, cannot be created again in Request/;
Modified: Mouse/trunk/t/800_shikabased/010-isa-or.t
===================================================================
--- Mouse/trunk/t/800_shikabased/010-isa-or.t 2008-12-22 02:36:38 UTC (rev 7145)
+++ Mouse/trunk/t/800_shikabased/010-isa-or.t 2008-12-22 02:40:16 UTC (rev 7146)
@@ -6,7 +6,7 @@
package Foo;
use Mouse;
use Mouse::Util::TypeConstraints;
- subtype Baz => where { defined($_) && $_ eq 'Baz' };
+ type Baz => where { defined($_) && $_ eq 'Baz' };
coerce Baz => from 'ArrayRef', via { 'Baz' };
has 'bar' => ( is => 'rw', isa => 'Str | Baz | Undef', coerce => 1 );
}
@@ -53,10 +53,10 @@
use Mouse;
use Mouse::Util::TypeConstraints;
- subtype 'Type1' => where { defined($_) && $_ eq 'Name' };
+ type 'Type1' => where { defined($_) && $_ eq 'Name' };
coerce 'Type1', from 'Str', via { 'Names' };
- subtype 'Type2' => where { defined($_) && $_ eq 'Group' };
+ type 'Type2' => where { defined($_) && $_ eq 'Group' };
coerce 'Type2', from 'Str', via { 'Name' };
has 'foo' => ( is => 'rw', isa => 'Type1|Type2', coerce => 1 );
@@ -76,7 +76,7 @@
use Mouse;
use Mouse::Util::TypeConstraints;
- subtype 'Type3' => where { defined($_) && $_ eq 'Name' };
+ type 'Type3' => where { defined($_) && $_ eq 'Name' };
coerce 'Type3', from 'CodeRef', via { 'Name' };
has 'foo' => ( is => 'rw', isa => 'Type3|KLASS|Undef', coerce => 1 );
Modified: Mouse/trunk/t/800_shikabased/014-subtype-as.t
===================================================================
--- Mouse/trunk/t/800_shikabased/014-subtype-as.t 2008-12-22 02:36:38 UTC (rev 7145)
+++ Mouse/trunk/t/800_shikabased/014-subtype-as.t 2008-12-22 02:40:16 UTC (rev 7146)
@@ -37,7 +37,7 @@
);
- subtype 'Type4';
+ type 'Type4';
has any => (
is => 'rw',
isa => 'Type4',
Modified: Mouse/trunk/t/800_shikabased/801-mousex_types.t
===================================================================
--- Mouse/trunk/t/800_shikabased/801-mousex_types.t 2008-12-22 02:36:38 UTC (rev 7145)
+++ Mouse/trunk/t/800_shikabased/801-mousex_types.t 2008-12-22 02:40:16 UTC (rev 7146)
@@ -7,7 +7,7 @@
use MouseX::Types -declare => [qw/ Headers /];
use MouseX::Types::Mouse 'HashRef';
- subtype Headers, where { defined $_ && eval { $_->isa('Headers1') } };
+ type Headers, where { defined $_ && eval { $_->isa('Headers1') } };
coerce Headers,
from HashRef, via {
Headers1->new(%{ $_ });
@@ -20,7 +20,7 @@
use MouseX::Types -declare => [qw/ Headers /];
use MouseX::Types::Mouse 'HashRef';
- subtype Headers, where { defined $_ && eval { $_->isa('Headers2') } };
+ type Headers, where { defined $_ && eval { $_->isa('Headers2') } };
coerce Headers,
from HashRef, via {
Headers2->new(%{ $_ });
Modified: Mouse/trunk/t/800_shikabased/802-mousex_types-isa-or.t
===================================================================
--- Mouse/trunk/t/800_shikabased/802-mousex_types-isa-or.t 2008-12-22 02:36:38 UTC (rev 7145)
+++ Mouse/trunk/t/800_shikabased/802-mousex_types-isa-or.t 2008-12-22 02:40:16 UTC (rev 7146)
@@ -9,13 +9,13 @@
use MouseX::Types -declare => [qw/ Baz Type1 Type2 /];
use MouseX::Types::Mouse qw( ArrayRef );
- subtype Baz, where { defined($_) && $_ eq 'Baz' };
+ type Baz, where { defined($_) && $_ eq 'Baz' };
coerce Baz, from ArrayRef, via { 'Baz' };
- subtype Type1, where { defined($_) && $_ eq 'Name' };
+ type Type1, where { defined($_) && $_ eq 'Name' };
coerce Type1, from 'Str', via { 'Names' };
- subtype Type2, where { defined($_) && $_ eq 'Group' };
+ type Type2, where { defined($_) && $_ eq 'Group' };
coerce Type2, from 'Str', via { 'Name' };
}
More information about the Moose-commits
mailing list