/[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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 921 - (hide annotations)
Mon Jan 5 20:30:53 2009 UTC (15 years, 4 months ago) by dpavlin
File MIME type: application/x-troff
File size: 718 byte(s)
test time validator in first column of sponge
1 dpavlin 860 #!/usr/bin/perl
2     use strict;
3     use warnings;
4    
5     my $debug = @ARGV ? 1 : 0;
6    
7 dpavlin 921 use Test::More tests => 7;
8 dpavlin 860 use lib 'lib';
9    
10     use Data::Dump qw/dump/;
11    
12     BEGIN {
13     use_ok('Frey::jQuery::flot');
14     }
15    
16 dpavlin 921 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 dpavlin 860 ok( my $markup = $o->as_markup, 'as_markup' );
28     diag $markup if $debug;
29     like( $markup, qr/\.plot/, 'markup content' );
30    
31 dpavlin 921 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    

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26