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

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

Simplified Publish::iCal, slightly modified version of that of Kentaro. Support full-day event if entry datetime is 00:00. No event API

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, "20060710T223213";
35
36 === Full day event
37 --- ONLY
38 --- input config
39 plugins:
40   - module: CustomFeed::Debug
41     config:
42       title: Foo Bar Calendar
43       entry:
44         - date: 2006/10/20
45           title: Shibuya.pm Tech Talks
46         - date: 2006/10/22
47           title: Shibuya.pm Tech Talks
48   - module: Publish::iCal
49     config:
50       dir: $FindBin::Bin
51       filename: $::filename
52 --- expected
53 ok -e $::output;
54 my $ical = Data::ICal->new(filename => $::output);
55 is @{$ical->entries}, 2;
56 is $ical->entries->[0]->property('dtstart')->[0]->value, "20061020";
57 is_deeply $ical->entries->[0]->property('dtstart')->[0]->parameters, { VALUE => 'DATE' };
58
Note: See TracBrowser for help on using the browser.