Sha256: 68dab8dfb363716220ec536e3d7d3da6dac94168ddd99338715c1007120c8132
Contents?: true
Size: 1.08 KB
Versions: 4
Compression:
Stored size: 1.08 KB
Contents
# frozen_string_literal: true require 'cucumber/core/event_bus' require 'cucumber/core/gherkin/parser' require 'cucumber/core/gherkin/document' require 'cucumber/core/compiler' require 'cucumber/core/test/runner' module Cucumber module Core def execute(gherkin_documents, filters = [], event_bus = EventBus.new) yield event_bus if block_given? receiver = Test::Runner.new(event_bus) compile gherkin_documents, receiver, filters self end def compile(gherkin_documents, last_receiver, filters = []) first_receiver = compose(filters, last_receiver) compiler = Compiler.new(first_receiver) parse gherkin_documents, compiler self end private def parse(gherkin_documents, compiler) parser = Core::Gherkin::Parser.new(compiler) gherkin_documents.each do |document| parser.document document end parser.done self end def compose(filters, last_receiver) filters.reverse.reduce(last_receiver) do |receiver, filter| filter.with_receiver(receiver) end end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
cucumber-core-3.1.0 | lib/cucumber/core.rb |
cucumber-core-3.0.0 | lib/cucumber/core.rb |
cucumber-core-3.0.0.pre.2 | lib/cucumber/core.rb |
cucumber-core-2.0.0 | lib/cucumber/core.rb |