Sha256: 15ba820d3afe73000c2bddb6f453c1222715f573a2f60fa30c3d4053f025845a

Contents?: true

Size: 1 KB

Versions: 16

Compression:

Stored size: 1 KB

Contents

module Cucumber
  module Core
    module Test
      module Filters

        # This filter is used for testing Cucumber itself. It adds step definitions
        # that will activate steps to have passed / failed / pending results
        # if they use conventional names.
        #
        # It was extracted from our test code, and does not have any tests of its own.
        class ActivateStepsForSelfTest < Core::Filter.new
          Failure = Class.new(StandardError)

          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 /pending/
                step.with_action { raise Test::Result::Pending }
              when /pass/
                step.with_action {}
              else
                step
              end
            end

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

      end
    end
  end
end

Version data entries

16 entries across 16 versions & 4 rubygems

Version Path
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/cucumber-core-12.0.0/lib/cucumber/core/test/filters/activate_steps_for_self_test.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/cucumber-core-11.1.0/lib/cucumber/core/test/filters/activate_steps_for_self_test.rb
cucumber-core-12.0.0 lib/cucumber/core/test/filters/activate_steps_for_self_test.rb
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-core-11.0.0/lib/cucumber/core/test/filters/activate_steps_for_self_test.rb
rubypitaya-3.12.4 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-core-11.0.0/lib/cucumber/core/test/filters/activate_steps_for_self_test.rb
rubypitaya-3.12.3 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-core-11.0.0/lib/cucumber/core/test/filters/activate_steps_for_self_test.rb
rubypitaya-3.12.2 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-core-11.0.0/lib/cucumber/core/test/filters/activate_steps_for_self_test.rb
cucumber-core-11.1.0 lib/cucumber/core/test/filters/activate_steps_for_self_test.rb
cucumber-core-11.0.0 lib/cucumber/core/test/filters/activate_steps_for_self_test.rb
cucumber-core-10.1.1 lib/cucumber/core/test/filters/activate_steps_for_self_test.rb
phillipug-foodie-0.1.0 .vendor/ruby/3.0.0/gems/cucumber-core-10.1.0/lib/cucumber/core/test/filters/activate_steps_for_self_test.rb
cucumber-core-10.1.0 lib/cucumber/core/test/filters/activate_steps_for_self_test.rb
cucumber-core-10.0.1 lib/cucumber/core/test/filters/activate_steps_for_self_test.rb
cucumber-core-10.0.0 lib/cucumber/core/test/filters/activate_steps_for_self_test.rb
cucumber-core-9.0.1 lib/cucumber/core/test/filters/activate_steps_for_self_test.rb
cucumber-core-9.0.0 lib/cucumber/core/test/filters/activate_steps_for_self_test.rb