Skip to content

Commit 947448d

Browse files
committed
[Core] Provide a unique id of the current scenario to the hooks.
Provide methods to access the pickle uri and the pickle lines, which uniquely identify the current scenario. In addition also put back the getId() method. Even though it is not possible to provide the same id string as when using Gherkin v2.12.2, hooks using Scenario.getId() will still compile and still get a unique id for the scenario through that method.
1 parent b7e9317 commit 947448d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sources/src/test/scala/cucumber/api/scala/ScalaDslTest.scala

+6-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ class ScalaDslTest {
2222
def getName = ""
2323

2424
def getId = ""
25+
26+
def getUri = ""
27+
28+
def getLines = null
29+
2530
}
2631

2732
@Test
@@ -128,7 +133,7 @@ class ScalaDslTest {
128133

129134
assertEquals(1, Dummy.stepDefinitions.size)
130135
val step = Dummy.stepDefinitions.head
131-
assertEquals("ScalaDslTest.scala:126", step.getLocation(true)) // be careful with formatting or this test will break
136+
assertEquals("ScalaDslTest.scala:131", step.getLocation(true)) // be careful with formatting or this test will break
132137
assertEquals("x", step.getPattern)
133138
step.execute("en", Array())
134139
assertTrue(called)

0 commit comments

Comments
 (0)