Sha256: 01c6756be2f273d0390c8c381bce2bf14352b0c0b4faf1df4fede0c889f41363

Contents?: true

Size: 1.43 KB

Versions: 26

Compression:

Stored size: 1.43 KB

Contents

Feature: Table diffing

  To allow you to more easily compare data in tables, you are able
  to easily diff a table with expected data and see the diff in your
  output.

  Scenario: Extra row
    Given a file named "features/tables.feature" with:
      """
      Feature: Tables
        Scenario: Extra row
          Then the table should be:
            | x | y |
            | a | b |
      """
    And a file named "features/step_definitions/steps.rb" with:
      """
      Then /the table should be:/ do |expected| x=1
        expected.diff!(table(%{
          | x | y |
          | a | c |
        }))
      end
      """
    When I run `cucumber features/tables.feature`
    Then it should fail with exactly:
      """
      Feature: Tables

        Scenario: Extra row         # features/tables.feature:2
          Then the table should be: # features/step_definitions/steps.rb:1
            | x | y |
            | a | b |
            Tables were not identical:
            
              |     x |     y |
              | (-) a | (-) b |
              | (+) a | (+) c |
             (Cucumber::MultilineArgument::DataTable::Different)
            ./features/step_definitions/steps.rb:2:in `/the table should be:/'
            features/tables.feature:3:in `Then the table should be:'

      Failing Scenarios:
      cucumber features/tables.feature:2 # Scenario: Extra row

      1 scenario (1 failed)
      1 step (1 failed)
      0m0.012s

      """

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
cucumber-3.0.1 features/docs/defining_steps/table_diffing.feature
cucumber-2.99.0 features/docs/defining_steps/table_diffing.feature
cucumber-3.0.0 features/docs/defining_steps/table_diffing.feature
cucumber-3.0.0.pre.2 features/docs/defining_steps/table_diffing.feature
mobiusloop-0.1.5 features/docs/defining_steps/table_diffing.feature
cucumber-3.0.0.pre.1 features/docs/defining_steps/table_diffing.feature
cucumber-2.4.0 features/docs/defining_steps/table_diffing.feature
mobiusloop-0.1.3 features/docs/defining_steps/table_diffing.feature
mobiusloop-0.1.2 features/docs/defining_steps/table_diffing.feature
cucumber-2.3.3 features/docs/defining_steps/table_diffing.feature
cucumber-2.3.2 features/docs/defining_steps/table_diffing.feature
cucumber-2.3.1 features/docs/defining_steps/table_diffing.feature
cucumber-2.3.0 features/docs/defining_steps/table_diffing.feature
cucumber-2.2.0 features/docs/defining_steps/table_diffing.feature
cucumber-2.1.0 features/docs/defining_steps/table_diffing.feature
cucumber-2.0.2 features/docs/defining_steps/table_diffing.feature
cucumber-2.0.1 features/docs/defining_steps/table_diffing.feature
cucumber-2.0.0 features/docs/defining_steps/table_diffing.feature
cucumber-2.0.0.rc.5 features/docs/defining_steps/table_diffing.feature
cucumber-2.0.0.rc.4 features/docs/defining_steps/table_diffing.feature