Skip to content

Commit b10baaa

Browse files
committed
add XML integration test
1 parent d9f5b02 commit b10baaa

5 files changed

Lines changed: 22 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ tests:
9898
lines: # Assert specific lines
9999
1: "/bin/sh: 1: invalid: not found"
100100
json:
101-
.object.attr: hello # Make assertions on json objects
101+
object.attr: hello # Make assertions on json objects
102102
xml:
103103
"//book//auhtor": Steven King # Make assertions on xml documents
104104
exit-code: 127

commander_unix.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ tests:
1212
stdout:
1313
contains:
1414
- ✓ it should exit with error code
15-
line-count: 26
15+
line-count: 15
1616
exit-code: 0
1717

1818
it should assert that commander will fail:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<books>
2+
<book>
3+
<author>J. R. R. Tolkien</author>
4+
<title>Lord of the Rngs</title>
5+
</book>
6+
<book>
7+
<author>Joanne K. Rowling</author>
8+
<title>Harry Potter</title>
9+
</book>
10+
</books>

integration/unix/commander_test.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,12 @@ tests:
4949
command: cat ./integration/unix/_fixtures/book.json
5050
stdout:
5151
json:
52-
books.0.author: J. R. R. Tolkien
52+
books.0.author: J. R. R. Tolkien
53+
books.1.author: Joanne K. Rowling
54+
55+
it should assert xml:
56+
command: cat ./integration/unix/_fixtures/book.xml
57+
stdout:
58+
xml:
59+
/books/0/author: J. R. R. Tokien
60+
/books/1/author: Joanne K. Rowling

pkg/suite/yaml_suite.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ func (y *YAMLConfig) convertToExpectedOut(value interface{}) runtime.ExpectedOut
179179
"line-count",
180180
"lines",
181181
"json",
182+
"xml",
182183
"not-contains":
183184
break
184185
default:

0 commit comments

Comments
 (0)