Skip to content

Commit 7c933f9

Browse files
committed
Added unit test for Guid element
1 parent eb0c708 commit 7c933f9

File tree

1 file changed

+23
-0
lines changed
  • src/test/groovy/com/github/magneticflux/rss/namespaces/standard/elements

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.github.magneticflux.rss.namespaces.standard.elements
2+
3+
import com.github.magneticflux.rss.PersisterSpecification
4+
import spock.lang.Unroll
5+
6+
class GuidTest extends PersisterSpecification {
7+
@Unroll
8+
def 'enclosure #object read/write'() {
9+
10+
expect: 'the output XML equals the given XML'
11+
persister.write(object) == xml
12+
13+
and: 'the input object equals the given object'
14+
persister.read(Guid, xml) == object
15+
16+
where:
17+
isPermaLinkRaw | text | xml
18+
'true' | 'testText' | """<guid isPermaLink="$isPermaLinkRaw">$text</guid>"""
19+
'false' | 'testText' | """<guid isPermaLink="$isPermaLinkRaw">$text</guid>"""
20+
null | 'testText' | """<guid>$text</guid>"""
21+
object = new Guid(isPermaLinkRaw, text)
22+
}
23+
}

0 commit comments

Comments
 (0)