t/text/vcard/node/add_types.t
raw| 1 | use Test::Most; |
| 2 | use Text::vCard::Addressbook; |
| 3 | |
| 4 | my $address_book = Text::vCard::Addressbook->new; |
| 5 | my $vcard = $address_book->add_vcard(); |
| 6 | $vcard->version('2.07'); |
| 7 | $vcard->fullname("My Name"); |
| 8 | |
| 9 | my $mail_node = $vcard->add_node({'node_type' => 'EMAIL'}); |
| 10 | $mail_node->add_types('INTERNET'); |
| 11 | $mail_node->value( "john\@example.org" ); |
| 12 | |
| 13 | my $string = $address_book->export; |
| 14 | |
| 15 | like $string, qr/TYPE=internet/, 'add_types() works'; |
| 16 | |
| 17 | done_testing; |