Sha256: aa4d48fea21d0c830b8d14dbab021edec6a8ad4eafff9182d663d88397f53e88

Contents?: true

Size: 1.49 KB

Versions: 52

Compression:

Stored size: 1.49 KB

Contents

require 'socket'
require 'json'
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(step_mother)
        @connections = []
      end
      
      def alias_adverbs(adverbs)
      end

      def load_code_file(wire_file)
        config = Configuration.new(wire_file)
        @connections << Connection.new(config)
      end
      
      def snippet_text(code_keyword, step_name, multiline_arg_class)
        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

52 entries across 50 versions & 11 rubygems

Version Path
candlepin-api-0.4.0 bundle/ruby/gems/cucumber-1.2.1/lib/cucumber/wire_support/wire_language.rb
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/cucumber-1.2.1/lib/cucumber/wire_support/wire_language.rb
candlepin-api-0.4.0 bundle/ruby/1.8/gems/cucumber-1.2.1/lib/cucumber/wire_support/wire_language.rb
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/cucumber-1.2.1/lib/cucumber/wire_support/wire_language.rb
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/cucumber-1.2.1/lib/cucumber/wire_support/wire_language.rb
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/cucumber-1.2.1/lib/cucumber/wire_support/wire_language.rb
casecumber-1.0.2.1 lib/cucumber/wire_support/wire_language.rb
casecumber-1.2.1.cb2 lib/cucumber/wire_support/wire_language.rb
librarian-puppet-0.9.3 vendor/gems/ruby/1.8/gems/cucumber-1.2.1/lib/cucumber/wire_support/wire_language.rb
cucumber-1.2.1 lib/cucumber/wire_support/wire_language.rb
resque-pool-0.3.0 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/lib/cucumber/wire_support/wire_language.rb
ftl-0.2.0 vendor/bundle/gems/cucumber-1.2.0/lib/cucumber/wire_support/wire_language.rb
cucumber-1.2.0 lib/cucumber/wire_support/wire_language.rb
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/lib/cucumber/wire_support/wire_language.rb
frameworks-capybara-0.2.0.rc5 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/lib/cucumber/wire_support/wire_language.rb
frameworks-capybara-0.2.0.rc4 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/lib/cucumber/wire_support/wire_language.rb
frameworks-capybara-0.2.0.rc3 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/lib/cucumber/wire_support/wire_language.rb
frameworks-capybara-0.2.0.rc2 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/lib/cucumber/wire_support/wire_language.rb
resque-pool-0.3.0.beta.2 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/lib/cucumber/wire_support/wire_language.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/cucumber-1.1.9/lib/cucumber/wire_support/wire_language.rb