Sylvain Munaut: Abusing Calypso
[HTML5TV.git] / t / HTML5TV-hCalendar.t
1 #!/usr/bin/perl
2
3 use warnings;
4 use strict;
5
6 use Test::More tests => 10;
7
8 use lib 'lib';
9
10 BEGIN {
11         use_ok( 'HTML5TV::hCalendar' );
12 }
13
14 my $path = shift @ARGV || 'media/hCalendar.html';
15
16 ok( my $hcal = HTML5TV::hCalendar->new( $path ), "new $path" );
17
18 ok( my $html = $hcal->as_HTML, 'as_HTML' );
19 diag $html;
20
21 ok( my $date = $hcal->dtstart_iso, 'dtstart_iso' );
22 diag $date;
23
24 foreach my $class ( qw/organiser summary url location dtstart description/ ) {
25         ok( defined( my $text = $hcal->$class ), $class );
26         diag "$class: $text";
27 }
28