octopus-platform/bjoern

Step definitions visible in all shells

Closed this issue · 0 comments

There is currently no way to prevent Gremlin steps defined in one shell to become visible in all other shells. The reason is that threads share classes, and in particular methods registered dynamically via $Class.metaClass.method. In practice, this means that a user can override steps used by another user.

While it seems to not be easily possible to host per-thread classes, we could at least ensure that users don't overwrite another user's steps by accident. A solution would be to create a catch-all handler for unknown steps, and redirect to functions by that name that are stored in the binding. This would have the nice side-effect that steps are now defined as closures, and thus, groovydoc will recognize them.