Sha256: bb2176350da6073f7e58a7b12b393fa0679e0cce04303857be4673db9713ae08

Contents?: true

Size: 470 Bytes

Versions: 2

Compression:

Stored size: 470 Bytes

Contents

# frozen_string_literal: true
# Filter that activates steps with obvious pass / fail behaviour
class StandardStepActions < Cucumber::Core::Filter.new
  def test_case(test_case)
    test_steps = test_case.test_steps.map do |step|
      case step.text
      when /fail/
        step.with_action { raise Failure }
      when /pass/
        step.with_action {}
      else
        step
      end
    end

    test_case.with_steps(test_steps).describe_to(receiver)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cucumber-3.0.1 spec/support/standard_step_actions.rb
cucumber-3.0.0 spec/support/standard_step_actions.rb