diff --git a/t/example.t b/t/example.t index 890c4da..6ea4b4b 100644 --- a/t/example.t +++ b/t/example.t @@ -58,6 +58,14 @@ $registry->add_type( count => $xtra->{count}, total => 0+ @$data, } + }, + top_level_links => { + self => '/articles', + }, + links => { + self => sub($data,@) { + return "/articles/" . $data->{id}; + }, } } ); @@ -72,6 +80,9 @@ like $output => { "count"=> 2, "total"=> 1 }, + "links"=> { + "self"=> "/articles" + }, }; done_testing(); diff --git a/t/registry.t b/t/registry.t index dd14fb3..e5277c9 100644 --- a/t/registry.t +++ b/t/registry.t @@ -11,6 +11,7 @@ $registry->add_type( id => 'id', links => { self => sub ( $data, @ ) { + no warnings qw/ uninitialized /; return "/peoples/$data->{id}"; } } } );