Skip to content

All ScalaHookDefinition.location point to same locationΒ #404

@mpkorstanje

Description

@mpkorstanje

πŸ‘“ What did you see?

Currently the source reference for all hooks points to io.cucumber.scala.GlueAdaptor.$anonfun$loadRegistry$8 which doesn't seem quite right.

βœ… What did you expect to see?

A source reference inside the step definition file.

πŸ“¦ Which tool/library version are you using?

No response

πŸ”¬ How could we reproduce it?

No response

πŸ“š Any additional context?

The current implementation returns the location from the stack trace created here:

override val location: StackTraceElement = new Exception().getStackTrace()(3)

But this has the wrong location because hooks are created from ScalaHookDetails in the GlueAdaptor. The ScalaHookDetails.location does seem to be correct. So presumably the fix would be to:

override val location: StackTraceElement = hookDetails.stackTraceElement

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions