Sha256: f0a9ca5c8138ebe832a30c0adf03315a453912bc0463397392ad041ce0aaae59

Contents?: true

Size: 1.47 KB

Versions: 24

Compression:

Stored size: 1.47 KB

Contents

require 'multi_json'
require 'socket'
require 'cucumber/wire_support/connection'
require 'cucumber/wire_support/configuration'
require 'cucumber/wire_support/wire_packet'
require 'cucumber/wire_support/wire_exception'
require 'cucumber/wire_support/wire_step_definition'

module Cucumber
  module WireSupport

    # The wire-protocol (lanugage independent) implementation of the programming
    # language API.
    class WireLanguage
      include LanguageSupport::LanguageMethods

      def initialize(runtime)
        @connections = []
      end

      def alias_adverbs(adverbs)
      end

      def load_code_file(wire_file)
        config = Configuration.from_file(wire_file)
        @connections << Connection.new(config)
      end

      def snippet_text(code_keyword, step_name, multiline_arg_class, snippet_type)
        snippets = @connections.map do |remote|
          remote.snippet_text(code_keyword, step_name, multiline_arg_class.to_s)
        end
        snippets.flatten.join("\n")
      end

      def step_matches(step_name, formatted_step_name)
        @connections.map{ |c| c.step_matches(step_name, formatted_step_name)}.flatten
      end

      protected

      def begin_scenario(scenario)
        @connections.each { |c| c.begin_scenario(scenario) }
        @current_scenario = scenario
      end

      def end_scenario
        scenario = @current_scenario
        @connections.each { |c| c.end_scenario(scenario) }
        @current_scenario = nil
      end
    end
  end
end

Version data entries

24 entries across 22 versions & 2 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/cucumber-1.3.16/lib/cucumber/wire_support/wire_language.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/cucumber-1.3.18/lib/cucumber/wire_support/wire_language.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/cucumber-1.3.18/lib/cucumber/wire_support/wire_language.rb
cucumber-1.3.20 lib/cucumber/wire_support/wire_language.rb
cucumber-1.3.19 lib/cucumber/wire_support/wire_language.rb
cucumber-1.3.18 lib/cucumber/wire_support/wire_language.rb
cucumber-1.3.17 lib/cucumber/wire_support/wire_language.rb
cucumber-1.3.16 lib/cucumber/wire_support/wire_language.rb
cucumber-1.3.15 lib/cucumber/wire_support/wire_language.rb
cucumber-1.3.14 lib/cucumber/wire_support/wire_language.rb
cucumber-1.3.13 lib/cucumber/wire_support/wire_language.rb
cucumber-1.3.12 lib/cucumber/wire_support/wire_language.rb
cucumber-1.3.11 lib/cucumber/wire_support/wire_language.rb
cucumber-1.3.10 lib/cucumber/wire_support/wire_language.rb
cucumber-1.3.9 lib/cucumber/wire_support/wire_language.rb
cucumber-1.3.8 lib/cucumber/wire_support/wire_language.rb
cucumber-1.3.7 lib/cucumber/wire_support/wire_language.rb
cucumber-1.3.6 lib/cucumber/wire_support/wire_language.rb
cucumber-1.3.5 lib/cucumber/wire_support/wire_language.rb
cucumber-1.3.4 lib/cucumber/wire_support/wire_language.rb