summaryrefslogtreecommitdiff
path: root/Data-MultiValued/t
diff options
context:
space:
mode:
Diffstat (limited to 'Data-MultiValued/t')
-rw-r--r--Data-MultiValued/t/json.t14
-rw-r--r--Data-MultiValued/t/moose-tagged.t18
2 files changed, 16 insertions, 16 deletions
diff --git a/Data-MultiValued/t/json.t b/Data-MultiValued/t/json.t
index 09664bf..ca7986b 100644
--- a/Data-MultiValued/t/json.t
+++ b/Data-MultiValued/t/json.t
@@ -3,13 +3,13 @@ use strict;
use warnings;
package Foo;{
use Moose;
-use Data::MultiValued::AttributeTrait::Tagged;
+use Data::MultiValued::AttributeTrait::Tags;
use Data::Printer;
has stuff => (
is => 'rw',
isa => 'Int',
- traits => ['MultiValued::Tagged'],
+ traits => ['MultiValued::Tags'],
default => 3,
predicate => 'has_stuff',
clearer => 'clear_stuff',
@@ -18,7 +18,7 @@ has stuff => (
has other => (
is => 'rw',
isa => 'Str',
- traits => ['MultiValued::Tagged'],
+ traits => ['MultiValued::Tags'],
predicate => 'has_other',
clearer => 'clear_other',
);
@@ -31,7 +31,7 @@ sub new_in_place {
p $self;
for my $attr ($class->meta->get_all_attributes) {
- if ($attr->does('MultiValued::Tagged')) {
+ if ($attr->does('MultiValued::Tags')) {
$attr->_rebless_slot($self);
}
}
@@ -43,7 +43,7 @@ sub as_hash {
my %ret = %$self;
for my $attr ($self->meta->get_all_attributes) {
- if ($attr->does('MultiValued::Tagged')) {
+ if ($attr->does('MultiValued::Tags')) {
my $st = $attr->_as_hash($self);
if ($st) {
$ret{$attr->full_storage_slot} = $st;
@@ -66,7 +66,7 @@ my $opts={tag=>'something'};
my $json = JSON::XS->new->utf8;
my $obj = Foo->new(other=>'foo');
-$obj->stuff_tagged($opts,1234);
+$obj->stuff_multi($opts,1234);
my $hash = $obj->as_hash;
note p $hash;
my $str = $json->encode($hash);
@@ -78,7 +78,7 @@ note p $obj;
note p $obj2;
is($obj2->stuff,$obj->stuff,'stuff');
-is($obj2->stuff_tagged($opts),$obj->stuff_tagged($opts),'stuff tagged');
+is($obj2->stuff_multi($opts),$obj->stuff_multi($opts),'stuff tagged');
is($obj2->other,$obj->other,'other');
done_testing;
diff --git a/Data-MultiValued/t/moose-tagged.t b/Data-MultiValued/t/moose-tagged.t
index 86fb8b9..6e1ac7a 100644
--- a/Data-MultiValued/t/moose-tagged.t
+++ b/Data-MultiValued/t/moose-tagged.t
@@ -4,12 +4,12 @@ use warnings;
package Foo;{
use Moose;
-use Data::MultiValued::AttributeTrait::Tagged;
+use Data::MultiValued::AttributeTrait::Tags;
has stuff => (
is => 'rw',
isa => 'Int',
- traits => ['MultiValued::Tagged'],
+ traits => ['MultiValued::Tags'],
default => 3,
predicate => 'has_stuff',
clearer => 'clear_stuff',
@@ -18,7 +18,7 @@ has stuff => (
has other => (
is => 'rw',
isa => 'Str',
- traits => ['MultiValued::Tagged'],
+ traits => ['MultiValued::Tags'],
predicate => 'has_other',
clearer => 'clear_other',
);
@@ -52,16 +52,16 @@ subtest 'with tags' => sub {
my $opts = {tag=>'one'};
ok($obj->has_stuff,'has stuff');
- ok(!$obj->has_stuff_tagged($opts),'not has stuff tagged');
+ ok(!$obj->has_stuff_multi($opts),'not has stuff tagged');
ok(!$obj->has_other,'not has other');
- ok(!$obj->has_other_tagged($opts),'not has other tagged');
+ ok(!$obj->has_other_multi($opts),'not has other tagged');
- $obj->stuff_tagged($opts,7);
- $obj->other_tagged($opts,'foo');
+ $obj->stuff_multi($opts,7);
+ $obj->other_multi($opts,'foo');
is($obj->stuff,3,'default');
- is($obj->stuff_tagged($opts),7,'stuff tagged');
- is($obj->other_tagged($opts),'foo','other tagged');
+ is($obj->stuff_multi($opts),7,'stuff tagged');
+ is($obj->other_multi($opts),'foo','other tagged');
};
done_testing();