Sha256: 5b54dee4cdeb46e8ae4de0ac7ddb73db87f0ef01f8849b2dcccd4fd5b044decb

Contents?: true

Size: 564 Bytes

Versions: 4

Compression:

Stored size: 564 Bytes

Contents

# frozen_string_literal: true

module Cucumber
  class Runtime
    class StepHooks
      def initialize(hooks)
        @hooks = hooks
      end

      def apply(test_steps)
        test_steps.flat_map do |test_step|
          [test_step] + after_step_hooks(test_step)
        end
      end

      private

      def after_step_hooks(test_step)
        @hooks.map do |hook|
          action = ->(*args) { hook.invoke('AfterStep', [args, test_step]) }
          Hooks.after_step_hook(test_step.source, hook.location, &action)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
cucumber-3.2.0 lib/cucumber/runtime/step_hooks.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/cucumber-3.1.2/lib/cucumber/runtime/step_hooks.rb
cucumber-3.1.2 lib/cucumber/runtime/step_hooks.rb
cucumber-3.1.1 lib/cucumber/runtime/step_hooks.rb