Logo: Relish

  1. Sign in

Project: relish

Syntax Highlighting

As of Cucumber 1.0.3, you can specify a content type for a docstring, like this:

Given this is made of Ruby code:
  """ruby
  puts "hello"
  """

Relish understands these content types when rendering the step. We use
highlight.js, so the content type string you use needs to match one of their supported languages.

Scenarios
  • @javascript
Push a Scenario with a Ruby DocString
Given
a step with a multiline argument that looks like this:
"""ruby
puts "a string"
# Comment
"""
When
I view the page for the feature
Then
I should see the text "a string" highlighted as a string
And
I should see the text "# Comment" highlighted as a comment

Last published about 7 years ago by mattwynne.