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, #execute_after_step, #execute_transforms, #hooks_for, #invoked_step_definition, #unmatched_step_definitions

Constructor Details

#initialize(runtime) ⇒ WireLanguage

Returns a new instance of WireLanguage.



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

def initialize(runtime)
  @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.from_file(wire_file)
  @connections << Connection.new(config)
end

#snippet_text(code_keyword, step_name, multiline_arg_class, snippet_type) ⇒ 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, 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

#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