Open
Conversation
49dc042 to
71529d6
Compare
added 12 commits
September 12, 2019 23:12
cody-vibe
approved these changes
Oct 28, 2019
cody-vibe
left a comment
There was a problem hiding this comment.
I see nothing wrong with the ruby style used here. It seems to support namespacing inside modules, which normal cucumber does not seem to have so I would mark that as a plus.
Should be ready to
whenever you feel ready.
cody-vibe
reviewed
Oct 28, 2019
| Step definitions can be defined by requiring 'jukebox' and using `step`: | ||
|
|
||
| ```ruby | ||
| require jukebox |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jukebox - Polyglot Update
This update makes jukebox work with steps defined in multiple languages. Each step can be defined in a supported language (currently clojure or ruby). When a scenario is run, each step will be run in whichever language it's defined with.
Syntax
Here are some example step definition snippets:
How it works (architecture)
deps.ednorproject.cljfile in the current directory. Ruby is detected with the presense of aGemfile. This can also be defined explicitly in a.jukeboxfile (see below).jukebox language clientis launched for each language. In the default configuration, the clojure client is launched in memory. The ruby client is launched by runningbundle exec jcl_ruby. This can explicitly configured in a.jukeboxfile.Configuration
A jukebox configuration can be defined explicitly if needed in a project by creating a
.jukeboxfile with the following (JSON):{"languages": ["ruby", "clojure"]}In addition, the launcher details can be configured if needed by adding the "language-clients" configuration. These are the defaults:
{"languages": ["ruby", "clojure"], "language-clients": [{"language": "clojure", "launcher": "jlc-clj-embedded"}, {"language": "ruby", "launcher": "jlc-cli", "cmd": ["bundle", "exec", "jlc_ruby"]}]}Ruby Details
Defining Step Definitions & Hooks
Step definitions can be defined by requiring 'jukebox' and using
step:Cucumber Compatibility
If a step is defined in a cucumber style (
When,Then, etc), then the Ruby jukebox language client will switch to Cucumber compatibility mode. This mode replicates / requires the code to be laid out in the cucumber conventions. In compatibility mode, theboardis not provided to the step definition, unless the arity supports it.Clojure Details
Defining steps with metadata tags
Functions can be tagged as step definitions using function meta:
Functions can be tagged as hooks with the metadata keys:
:step/before,:step/after,:step/before-step, or:step/after-step:Defining steps with the
stepmacroSteps can now alternatively be defined with the
stepmacro that works like the Ruby version: