Merge pull request #152 from Codearte/feature/arrays_assertions_fix

Size assertion causes invalid specs for some arrays #151
This commit is contained in:
Mariusz Smykuła
2015-10-02 21:13:55 +02:00

View File

@@ -17,8 +17,7 @@ class JsonPathEntry {
if (optionalSuffix) {
return ["!${parsedJsonVariable}.read('''${jsonPath}''', JSONArray).empty"]
} else if (traversesOverCollections()) {
return ["${parsedJsonVariable}.read('''${jsonPath}''', JSONArray).size() == 1",
"${parsedJsonVariable}.read('''${jsonPath}''', JSONArray).get(0) ${operator()} ${potentiallyWrappedWithQuotesValue()}"]
return ["${parsedJsonVariable}.read('''${jsonPath}''', JSONArray).get(0) ${operator()} ${potentiallyWrappedWithQuotesValue()}"]
}
return ["${parsedJsonVariable}.read('''${jsonPath}''') ${operator()} ${potentiallyWrappedWithQuotesValue()}"]
}