Skip to content

Commit 6a354d1

Browse files
committed
Added unit test for TextInput element
1 parent 7be1e48 commit 6a354d1

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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 TextInputTest 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(TextInput, xml) == object
17+
18+
where:
19+
title | description | name | link | xml
20+
'testTitle' | 'testDescription' | 'testName' | testUrl() | """<textInput>
21+
| <title>$title</title>
22+
| <description>$description</description>
23+
| <name>$name</name>
24+
| <link>$link</link>
25+
|</textInput>""".stripMargin()
26+
27+
object = new TextInput(title, description, name, link)
28+
}
29+
}

0 commit comments

Comments
 (0)