Sha256: 7faeaa11dab84d52b0acf4a72a898c1b7c463482e10307a192d5d4c8ba48116d

Contents?: true

Size: 467 Bytes

Versions: 6

Compression:

Stored size: 467 Bytes

Contents

module Cucumber
  class Runtime
    class BeforeHooks
      def initialize(action_blocks)
        @action_blocks = action_blocks
      end

      def apply_to(test_case)
        test_case.with_steps(
          before_hooks(test_case.source) + test_case.test_steps
        )
      end

      private

      def before_hooks(source)
        @action_blocks.map do |action_block|
          Hooks.before_hook(source, &action_block)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cucumber-2.0.0 lib/cucumber/runtime/before_hooks.rb
cucumber-2.0.0.rc.5 lib/cucumber/runtime/before_hooks.rb
cucumber-2.0.0.rc.4 lib/cucumber/runtime/before_hooks.rb
cucumber-2.0.0.rc.3 lib/cucumber/runtime/before_hooks.rb
cucumber-2.0.0.rc.2 lib/cucumber/runtime/before_hooks.rb
cucumber-2.0.0.rc.1 lib/cucumber/runtime/before_hooks.rb