Class: Cucumber::WireSupport::WireLanguage

Inherits:
Object
  • Object
show all
Includes:
LanguageSupport::LanguageMethods
Defined in:
lib/cucumber/wire_support/wire_language.rb

Overview

The wire-protocol (lanugage independent) implementation of the programming language API.

Instance Method Summary collapse

Methods included from LanguageSupport::LanguageMethods

#add_hook, #add_transform, #after, #after_configuration, #around, #available_step_definition, #before, #clear_hooks, #create_step_match, #execute_after_step, #execute_transforms, #hooks_for, #invoked_step_definition, #unmatched_step_definitions

Constructor Details

#initialize(step_mother) ⇒ WireLanguage

Returns a new instance of WireLanguage.



17
18
19
# File 'lib/cucumber/wire_support/wire_language.rb', line 17

def initialize(step_mother)
  @connections = []
end

Instance Method Details

#alias_adverbs(adverbs) ⇒ Object



21
22
# File 'lib/cucumber/wire_support/wire_language.rb', line 21

def alias_adverbs(adverbs)
end

#load_code_file(wire_file) ⇒ Object



24
25
26
27
# File 'lib/cucumber/wire_support/wire_language.rb', line 24

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

#snippet_text(code_keyword, step_name, multiline_arg_class) ⇒ Object



29
30
31
32
33
34
# File 'lib/cucumber/wire_support/wire_language.rb', line 29

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

#step_matches(step_name, formatted_step_name) ⇒ Object



36
37
38
# File 'lib/cucumber/wire_support/wire_language.rb', line 36

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