File: 03.unknown-props.t

package info (click to toggle)
libdata-ical-perl 0.21%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 388 kB
  • ctags: 247
  • sloc: perl: 3,371; sh: 51; makefile: 2
file content (31 lines) | stat: -rw-r--r-- 884 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/perl -w

use warnings;
use strict;

use Test::More tests => 6;
use Test::LongString;
use Test::Warn;

BEGIN { use_ok('Data::ICal::Entry::Todo') }

my $todo = Data::ICal::Entry::Todo->new();
isa_ok($todo, 'Data::ICal::Entry::Todo');

warnings_are { $todo->add_property( summary => 'Sum it up.' ) } 
             [], "No warning on real property set";

warnings_are { $todo->add_property( "x-summary" => 'Experimentally sum it up.' ) } 
             [], "No warning on experimental property set";

warning_is { $todo->add_property( summmmary => 'Summmm it up.' ) }
    {carped => "Unknown property for Data::ICal::Entry::Todo: summmmary"}, 
    "Got a warning for fake property set";

is_string($todo->as_string( crlf => "\n"), <<END_VCAL, "Got the right output");
BEGIN:VTODO
SUMMARY:Sum it up.
SUMMMMARY:Summmm it up.
X-SUMMARY:Experimentally sum it up.
END:VTODO
END_VCAL