Show
Ignore:
Timestamp:
04/28/08 13:36:06 (7 months ago)
Author:
yusukebe
Message:

interface を変更, おそらくこの方が汎用性がある

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/WebService-Simple-Google-Chart/trunk/t/01_basic.t

    r10560 r10638  
    1212{ 
    1313    my $chart = WebService::Simple::Google::Chart->new; 
    14     ok($chart, "object created ok"); 
    15     isa_ok( $chart, "WebService::Simple::Google::Chart", "object isa WebService::Simple::Google::Chart" ); 
    16     my $data  = { foo => 200, bar => 130, hoge => 70 }; 
    17     my $url   = $chart->get_url( 
    18                             { 
    19                              size => "250x100", 
    20                              type => "p3", 
    21                              data => $data, 
    22                          } 
    23                             ); 
     14    ok( $chart, "object created ok" ); 
     15    isa_ok( 
     16        $chart, 
     17        "WebService::Simple::Google::Chart", 
     18        "object isa WebService::Simple::Google::Chart" 
     19    ); 
     20    my $data = { foo => 200, bar => 130, hoge => 70 }; 
     21    my $url = $chart->get_url( 
     22        { 
     23            chs  => "250x100", 
     24            cht => "p3", 
     25        }, 
     26        $data 
     27    ); 
    2428    my $uri = URI->new($url); 
    25     ok($uri->query_param("chs") eq "250x100", "chs parameter ok"); 
    26     ok($uri->query_param("cht") eq "p3", "cht parameter ok"); 
    27     ok($uri->query_param("chl") eq "bar|foo|hoge", "chl parameter ok"); 
    28     ok($uri->query_param("chd") eq "t:33,50,18", "chd parameter ok"); 
     29    ok( $uri->query_param("chs") eq "250x100",      "chs parameter ok" ); 
     30    ok( $uri->query_param("cht") eq "p3",           "cht parameter ok" ); 
     31    ok( $uri->query_param("chl") eq "bar|foo|hoge", "chl parameter ok" ); 
     32    ok( $uri->query_param("chd") eq "t:33,50,18",   "chd parameter ok" ); 
    2933}