mirror of https://github.com/sipwise/data-hal.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
578 B
29 lines
578 B
use strictures;
|
|
use Test::More import => [qw(done_testing ok)];
|
|
use Data::HAL qw();
|
|
use boolean qw(true false);
|
|
|
|
my $curies_link = Data::HAL::Link->new(
|
|
relation => 'curies',
|
|
href => 'http://purl.org/sipwise/ngcp-api/#rel-{rel}',
|
|
name => 'ngcp',
|
|
templated => true,
|
|
);
|
|
|
|
my $data = {
|
|
resource => {foo => 23, bar => 42},
|
|
links => [
|
|
$curies_link,
|
|
],
|
|
};
|
|
|
|
my $hal = Data::HAL->new(%{ $data });
|
|
ok($hal->as_json);
|
|
|
|
my $hal2 = Data::HAL->from_json($hal->as_json);
|
|
ok($hal2->as_json);
|
|
|
|
ok(1,"tests run");
|
|
|
|
done_testing;
|