Skip to content

Commit b732cc0

Browse files
committed
Added unit test for Source element
1 parent b383157 commit b732cc0

File tree

1 file changed

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

1 file changed

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

0 commit comments

Comments
 (0)