summaryrefslogtreecommitdiff
path: root/Data-MultiValued/t/json.t
diff options
context:
space:
mode:
Diffstat (limited to 'Data-MultiValued/t/json.t')
-rw-r--r--Data-MultiValued/t/json.t14
1 files changed, 7 insertions, 7 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;