Skip to content

Commit 319b109

Browse files
committed
Add upgrade documentation
1 parent 27449e2 commit 319b109

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/upgrade_v5.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,17 @@ Before { _ =>
5151
```
5252

5353
See also the [Hooks documentation](hooks.md).
54+
55+
## Under the hood
56+
57+
### Instantiate glue classes per scenario
58+
59+
Before Cucumber Scala 5.x, glue classes (classes extending `ScalaDsl`) were instantiated only once for a test suite.
60+
61+
This means that if you wanted to keep state between steps of your scenarios, you had to make sure the state was not shared to other scenarios by using hooks or manual checks.
62+
63+
Starting from Cucumber Scala 5.x, **each scenario creates new glue class instances**.
64+
65+
You should not notice any change unless you rely on state kept between scenarios in your glue classes.
66+
Please note that this is not the proper way to keep a state.
67+
You might want to use an `object` for this purpose.

0 commit comments

Comments
 (0)