/[Frey]/trunk/t/30-Frey-jQuery-flot.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/t/30-Frey-jQuery-flot.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 920 by dpavlin, Tue Dec 16 14:28:03 2008 UTC revision 921 by dpavlin, Mon Jan 5 20:30:53 2009 UTC
# Line 4  use warnings; Line 4  use warnings;
4    
5  my $debug = @ARGV ? 1 : 0;  my $debug = @ARGV ? 1 : 0;
6    
7  use Test::More tests => 4;  use Test::More tests => 7;
8  use lib 'lib';  use lib 'lib';
9    
10  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
# Line 13  BEGIN { Line 13  BEGIN {
13          use_ok('Frey::jQuery::flot');          use_ok('Frey::jQuery::flot');
14  }  }
15    
16  ok( my $o = Frey::jQuery::flot->new( request_url => '/', debug => $debug ), 'new' );  my $param = {
17            request_url => '/',
18            debug => $debug,
19    };
20    
21    ok( my $o = Frey::jQuery::flot->new( %$param,
22            sponge => {
23                    rows => [ [ '2009-01-05' ] ],
24                    NAME => [ 'foo' ],
25            },
26    ), 'new' );
27  ok( my $markup = $o->as_markup, 'as_markup' );  ok( my $markup = $o->as_markup, 'as_markup' );
28  diag $markup if $debug;  diag $markup if $debug;
29  like( $markup, qr/\.plot/, 'markup content' );  like( $markup, qr/\.plot/, 'markup content' );
30    
31    ok( my $invalid = Frey::jQuery::flot->new( %$param,
32            sponge => {
33                    rows => [ [ 0 ] ],
34                    NAME => [ 'invalid' ],
35            },
36    ), 'new with invalid time' );
37    eval { $invalid->as_markup };
38    ok( $@, 'died' );
39    like( $@, qr/time/, 'invalid time' );
40    

Legend:
Removed from v.920  
changed lines
  Added in v.921

  ViewVC Help
Powered by ViewVC 1.1.26