RubyMine 7.0.1 Web Help

RubyMine provides support for scenario outlines, enabling you to describe multiple scenarios by means of templates with placeholders. This support includes:

  • Code completion Ctrl+SpaceCtrl+SpaceCtrl+SpaceCtrl+SpaceAlt+SlashCtrl+SpaceCtrl+Space or Ctrl+Back SlashCtrl+SpaceCtrl+SpaceControl SpaceControl SpaceControl SpaceControl Space, Alt Escape or Shift Space for keywords.
  • Syntax highlighting for keywords, placeholders, and attributes.
  • Code inspection to detect missing examples, and a quick fix for generating Examples table stub.
To create examples table for a scenario outline, follow these general steps
  1. Having created a feature file, type the desired scenario outline. Use angle brackets to enclose placeholders. Note that initially the placeholders are not syntactically highlighted. If the steps are not defined, create step definitions. Since the Examples section is missing, RubyMine marks Scenario Outline name as an error.
  2. Press Alt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+Enter, Shift+Alt+J or Ctrl+Shift+MAlt+EnterAlt EnterAlt Enter⌘ 1Alt Enter to show the suggested intention action, and press EnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnter:

    scenarioOutline1.png

    The header row of the Examples table is created; so doing, the placeholders are highlighted both in the table header, and in the scenario outline steps.

  3. Add the desired rows to the Examples table:

    scenarioOutline2.png

    As you add rows, the columns in the Examples section are aligned automatically.

    Note highlighting of the placeholders, and the values in the Examples table, which will be substituted on running examples.

  • 2.0.2+If a colon is missing after the keyword Examples, it is recognized and marked as a syntax error, and a quick fix suggests to create colon.
  • You can add textual notes to the steps of a scenario outline. Such notes should be enclosed in triple quotes; in this case, RubyMine perceives the text inside as a string, and displays it when running the scenario step:

    scenarioOutline3.png

  • Note the difference in highlighting angle brackets of the placeholders that are differently represented in step definitions:

    ruby_ScenarioOutline4.png

See Also

Procedures:

Web Resources: