Class: Cucumber::PySupport::PyLanguage

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

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) ⇒ PyLanguage

Returns a new instance of PyLanguage.



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/cucumber/py_support/py_language.rb', line 8

def initialize(step_mother)
  @step_def_files = []
  #
  # @python_path = ENV['PYTHONPATH'] ? ENV['PYTHONPATH'].split(':') : []
  # add_to_python_path(File.dirname(__FILE__))
  #
  # RubyPython.start
  # at_exit{RubyPython.stop}
  #
  # import(File.dirname(__FILE__) + '/py_language.py')
end

Instance Method Details

#alias_adverbs(adverbs) ⇒ Object



24
25
# File 'lib/cucumber/py_support/py_language.rb', line 24

def alias_adverbs(adverbs)
end

#begin_scenario(scenario) ⇒ Object



35
36
37
38
39
40
41
42
43
44
# File 'lib/cucumber/py_support/py_language.rb', line 35

def begin_scenario(scenario)
  @python_path = []
  add_to_python_path(File.dirname(__FILE__))
  @step_def_files.each{|f| add_to_python_path(File.dirname(f))}

  RubyPython.start

  @delegate = import(File.dirname(__FILE__) + '/py_language.py')
  @step_def_files.each{|f| import(f)}
end

#end_scenarioObject



46
47
# File 'lib/cucumber/py_support/py_language.rb', line 46

def end_scenario
end

#load_code_file(py_file) ⇒ Object



20
21
22
# File 'lib/cucumber/py_support/py_language.rb', line 20

def load_code_file(py_file)
  @step_def_files << py_file
end

#snippet_text(code_keyword, step_name, multiline_arg_class) ⇒ Object



31
32
33
# File 'lib/cucumber/py_support/py_language.rb', line 31

def snippet_text(code_keyword, step_name, multiline_arg_class)
  "python snippet: #{code_keyword}, #{step_name}"
end

#step_definitions_for(py_file) ⇒ Object



27
28
29
# File 'lib/cucumber/py_support/py_language.rb', line 27

def step_definitions_for(py_file)
  mod = import(py_file)
end

#step_matches(step_name, name_to_report) ⇒ Object



49
50
51
# File 'lib/cucumber/py_support/py_language.rb', line 49

def step_matches(step_name, name_to_report)
  @delegate.step_matches(step_name, name_to_report)
end