root/trunk/plagger/t/plugins/Publish-iCal/base.t

Revision 1723 (checked in by miyagawa, 14 years ago)

Publish::iCal: don't add 1 hour duration. Fixed tests

Line 
1 use strict;
2 use t::TestPlagger;
3
4 our $filename = "foo.ics";
5 our $output = File::Spec->catfile($FindBin::Bin, $filename);
6
7 test_plugin_deps;
8 plan 'no_plan';
9 run_eval_expected;
10
11 END {
12     unlink $output if $output && -e $output;
13 }
14
15 __END__
16
17 ===
18 --- input config
19 plugins:
20   - module: Subscription::Config
21     config:
22       feed:
23         - file://$t::TestPlagger::BaseDirURI/t/samples/rss-full.xml
24
25   - module: Publish::iCal
26     config:
27       dir: $FindBin::Bin
28       filename: $::filename
29 --- expected
30 ok -e $::output;
31 my $ical = Data::ICal->new(filename => $::output);
32 is @{$ical->entries}, 5;
33 is $ical->entries->[0]->property('dtstart')->[0]->value, "20060710T213213";
34 is $ical->entries->[0]->property('dtend')->[0]->value, "20060710T213213";
35
36 === Full day event
37 --- input config
38 plugins:
39   - module: CustomFeed::Debug
40     config:
41       title: Foo Bar Calendar
42       entry:
43         - date: 2006/10/20
44           title: Shibuya.pm Tech Talks
45         - date: 2006/10/22
46           title: Shibuya.pm Tech Talks
47   - module: Publish::iCal
48     config:
49       dir: $FindBin::Bin
50       filename: $::filename
51 --- expected
52 ok -e $::output;
53 my $ical = Data::ICal->new(filename => $::output);
54 is @{$ical->entries}, 2;
55 is $ical->entries->[0]->property('dtstart')->[0]->value, "20061020";
56 is_deeply $ical->entries->[0]->property('dtstart')->[0]->parameters, { VALUE => 'DATE' };
57
Note: See TracBrowser for help on using the browser.