ASP4x-Linker
view release on metacpan or search on metacpan
t/010-basic/020-basic.t view on Meta::CPAN
#!/usr/bin/perl -w
use strict;
use warnings 'all';
use Test::More 'no_plan';
use ASP4::API;
use JSON::XS;
my $api; BEGIN { $api = ASP4::API->new }
use_ok('ASP4x::Linker');
BLANK: {
ok( my $res = $api->ua->get('/'), "GET /" );
ok( my $info = decode_json($res->content), "JSON is good" );
is_deeply $info, [
{
t/htdocs/index.asp view on Meta::CPAN
<%
use ASP4x::Linker;
use JSON::XS;
my $linker = ASP4x::Linker->new();
$linker->add_widget(
name => "widgetA",
attrs => [qw/ page_number page_size sort_dir sort_col /]
);
$linker->add_widget(
name => "widgetB",
t/htdocs/index.asp view on Meta::CPAN
my @result = map {
my $widget = $_;
my $res = {
$widget->name => {
map { ($_ => $widget->get( $_ )) }
$widget->attrs
}
};
$res;
} $linker->widgets;
%><%= JSON::XS->new->utf8->pretty->encode( \@result ) %>
( run in 0.451 second using v1.01-cache-2.11-cpan-4d50c553e7e )