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, #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.



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

def initialize(step_mother)
  @connections = []
end

Instance Method Details

#alias_adverbs(adverbs) ⇒ Object



28
29
# File 'lib/cucumber/wire_support/wire_language.rb', line 28

def alias_adverbs(adverbs)
end

#load_code_file(wire_file) ⇒ Object



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

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

#snippet_text(step_keyword, step_name, multiline_arg_class) ⇒ Object



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

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

#step_matches(step_name, formatted_step_name) ⇒ Object



43
44
45
# File 'lib/cucumber/wire_support/wire_language.rb', line 43

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