Class: Cucumber::Tcl::Framework
- Inherits:
-
Object
- Object
- Cucumber::Tcl::Framework
- Defined in:
- lib/cucumber/tcl/framework.rb
Constant Summary collapse
- TCL_FRAMEWORK_PATH =
"#{File.dirname(__FILE__)}/framework.tcl".freeze
Instance Method Summary collapse
- #execute_step_definition(*args) ⇒ Object
-
#initialize(cucumber_config = nil, path = TCL_FRAMEWORK_PATH) ⇒ Framework
constructor
A new instance of Framework.
- #step_definition_exists?(step_name) ⇒ Boolean
Constructor Details
#initialize(cucumber_config = nil, path = TCL_FRAMEWORK_PATH) ⇒ Framework
Returns a new instance of Framework.
6 7 8 9 10 11 12 |
# File 'lib/cucumber/tcl/framework.rb', line 6 def initialize(cucumber_config = nil, path = TCL_FRAMEWORK_PATH) @tcl = ::Tcl::Interp.load_from_file(path) all_files_to_load = cucumber_config.nil? ? [] : cucumber_config.all_files_to_load all_files_to_load.collect! { |f| f.gsub(/([\\\s{}])/, '\\\\\1') } @tcl.proc('source_files').call(all_files_to_load.join(' ')) end |
Instance Method Details
#execute_step_definition(*args) ⇒ Object
18 19 20 |
# File 'lib/cucumber/tcl/framework.rb', line 18 def execute_step_definition(*args) @tcl.proc('execute_step_definition').call(*args) end |
#step_definition_exists?(step_name) ⇒ Boolean
14 15 16 |
# File 'lib/cucumber/tcl/framework.rb', line 14 def step_definition_exists?(step_name) @tcl.proc('step_definition_exists').call(step_name) == '1' end |