-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df6d709
commit 6cdcdd5
Showing
5 changed files
with
87 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/test/groovy/net/fortuna/ical4j/vcard/VCardOutputterSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package net.fortuna.ical4j.vcard | ||
|
||
import spock.lang.Specification | ||
|
||
class VCardOutputterSpec extends Specification { | ||
|
||
def 'test output of vcard list'() { | ||
given: 'a list of cards' | ||
def list = new VCardBuilder(getClass().getResourceAsStream('/samples/vcard-rfc2426.vcf')) | ||
.buildAll() | ||
|
||
expect: 'string output matches expected' | ||
StringWriter w = [] | ||
new VCardOutputter(true).output(list, w) | ||
w as String == '''BEGIN:VCARD\r | ||
VERSION:3.0\r | ||
FN:Frank Dawson\r | ||
N:Dawson;Frank;;;\r | ||
ORG:Lotus Development Corporation\r | ||
ADR;TYPE=WORK,POSTAL,PARCEL:;;6544 Battleford Drive;Raleigh;NC;27613-3502\r | ||
;U.S.A.;\r | ||
TEL;TYPE=VOICE,MSG,WORK:+1-919-676-9515\r | ||
TEL;TYPE=FAX,WORK:+1-919-676-9564\r | ||
EMAIL;TYPE=INTERNET,PREF:[email protected]\r | ||
EMAIL;TYPE=INTERNET:[email protected]\r | ||
URL:http://home.earthlink.net/~fdawson\r | ||
END:VCARD\r | ||
\r | ||
BEGIN:VCARD\r | ||
VERSION:3.0\r | ||
FN:Tim Howes\r | ||
N:Howes;Tim;;;\r | ||
ORG:Netscape Communications Corp.\r | ||
ADR;TYPE=WORK:;;501 E. Middlefield Rd.;Mountain View;CA; 94043;U.S.A.;\r | ||
TEL;TYPE=VOICE,MSG,WORK:+1-415-937-3419\r | ||
TEL;TYPE=FAX,WORK:+1-415-528-4164\r | ||
EMAIL;TYPE=INTERNET:[email protected]\r | ||
END:VCARD\r | ||
''' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters