FuseBead-From-PNG
view release on metacpan or search on metacpan
t/007_when_viewing_response_as_json.t view on Meta::CPAN
my $png = Test::PNG->new({ width => $width, height => $height, unit_size => $unit_size, color => $color_rgb });
my $object = FuseBead::From::PNG->new({ filename => $png->filename, unit_size => $unit_size });
my $result = $object->process(view => 'JSON');
cmp_ok(ref($result) ? "it's a ref - " . ref($result) : "it's a scalar", 'eq', "it's a scalar", 'Result is a SCALAR and not a reference');
my $hash = eval { JSON->new->decode( $result ) } || {};
is_deeply($hash, $expected, "JSON decoded back to hash correctly");
$tests += 2;
}
( run in 0.424 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )