aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/base-test-utils/src/main/kotlin/renderers/SignatureUtils.kt
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/base-test-utils/src/main/kotlin/renderers/SignatureUtils.kt')
-rw-r--r--plugins/base/base-test-utils/src/main/kotlin/renderers/SignatureUtils.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/base/base-test-utils/src/main/kotlin/renderers/SignatureUtils.kt b/plugins/base/base-test-utils/src/main/kotlin/renderers/SignatureUtils.kt
index 1d725398..3397b2b4 100644
--- a/plugins/base/base-test-utils/src/main/kotlin/renderers/SignatureUtils.kt
+++ b/plugins/base/base-test-utils/src/main/kotlin/renderers/SignatureUtils.kt
@@ -11,7 +11,8 @@ fun TestOutputWriter.renderedContent(path: String = "root/example.html"): Elemen
.single()
fun Element.signature(): Elements = select("div.symbol.monospace")
-fun Element.firstSignature(): Element = signature().first()
+fun Element.firstSignature(): Element = signature().first() ?: throw NoSuchElementException("No signature found")
+fun Element.lastSignature(): Element = signature().last() ?: throw NoSuchElementException("No signature found")
class Parameters(vararg matchers: Any) : Tag("span", *matchers, expectedClasses = listOf("parameters"))
class Parameter(vararg matchers: Any) : Tag("span", *matchers, expectedClasses = listOf("parameter")) \ No newline at end of file