File: nested_steps_with_second_arg.feature

package info (click to toggle)
cucumber 2.4.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,076 kB
  • sloc: ruby: 17,016; javascript: 4,641; makefile: 12; sh: 10; tcl: 3
file content (54 lines) | stat: -rw-r--r-- 1,258 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Feature: Nested Steps with either table or doc string

  Background:
    Given a scenario with a step that looks like this:
      """gherkin
      Given two turtles
      """

  Scenario: Use #step with table
    Given a step definition that looks like this:
      """ruby
      Given /turtles:/ do |table|
        table.hashes.each do |row|
          puts row[:name]
        end
      end
      """
    And a step definition that looks like this:
      """ruby
      Given /two turtles/ do
        step %{turtles:}, table(%{
        | name      |
        | Sturm     |
        | Liouville |
        })
      end
      """
    When I run the feature with the progress formatter
    Then the output should contain:
      """
      Sturm

      Liouville

      """

  Scenario: Use #step with Doc String
    Given a step definition that looks like this:
      """ruby
      Given /two turtles/ do
        step %{turtles:}, "Sturm and Lioville"
      end
      """
    And a step definition that looks like this:
      """ruby
      Given /turtles:/ do |text|
        puts "#{text}:#{text.class}"
      end
      """
    When I run the feature with the progress formatter
    Then the output should contain:
      """
      Sturm and Lioville:String
      """