Changeset 2412

Show
Ignore:
Timestamp:
01/10/08 07:32:32
Author:
miyagawa
Message:

JSON 2.x compatiblity

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Catalyst-View-JSON/trunk/Makefile.PL

    r2381 r2412  
    55 
    66build_requires 'Test::More'; 
    7 build_requires $_ for qw( JSON JSON::Parser JSON::Converter ); 
    87 
    9 requires 'JSON::Any', 1.11
     8requires 'JSON::Any', 1.15
    109requires 'Catalyst', 5.60; 
    1110 
  • Catalyst-View-JSON/trunk/t/01_server.t

    r2186 r2412  
    66 
    77use Encode; 
    8 use Test::More tests => 38
     8use Test::More
    99use Catalyst::Test 'TestApp'; 
    10 use JSON (); 
     10 
     11eval "use JSON 2.04"; 
     12if ($@) { 
     13    plan skip_all => "JSON 2.04 is needed for testing"; 
     14
     15 
     16plan tests => 38; 
    1117 
    1218BEGIN { 
     
    3541    is_deeply( [ $response->content_type ], [ 'application/json', 'charset=utf-8' ] ); 
    3642 
    37     my $data = JSON::jsonToObj($response->content); 
     43    my $data = JSON::from_json($response->content); 
    3844    is $data->{json_foo}, "bar"; 
    3945    is_deeply $data->{json_baz}, [ 1, 2, 3 ]; 
     
    4955    is_deeply( [ $response->content_type ], [ 'application/json', 'charset=utf-8' ] ); 
    5056 
    51     my $data = JSON::jsonToObj($response->content); 
     57    my $data = JSON::from_json($response->content); 
    5258    is_deeply( $data, [1, 2, 3] ); 
    5359} 
     
    6470    ok $body =~ s/^foobar\((.*?)\);$/$1/sg, "wrapped in a callback"; 
    6571 
    66     my $data = JSON::jsonToObj($body); 
     72    my $data = JSON::from_json($body); 
    6773    is $data->{json_foo}, "bar"; 
    6874    is_deeply $data->{json_baz}, [ 1, 2, 3 ];