Sha256: 369977133cc96d96c764985b55e21e05b525387e45819720648a373dd9b078e2
Contents?: true
Size: 1.45 KB
Versions: 2
Compression:
Stored size: 1.45 KB
Contents
Given(/^the models provided by CukeModeler/) do @available_model_classes = Array.new.tap do |classes| CukeModeler.constants.each do |constant| if CukeModeler.const_get(constant).is_a?(Class) classes << CukeModeler.const_get(constant) if CukeModeler.const_get(constant).ancestors.include?(CukeModeler::Model) end end end end When(/^the model is output as a string$/) do |code_text| @output = eval(code_text) end And(/^a(?:n)? \w+(?: \w+)? model based on that gherkin$/) do |code_text| code_text = code_text.gsub('<source_text>', "'#{@source_text}'") eval(code_text) end Given(/^(?:a|the) (?:directory|feature file) is modeled$/) do |code_text| code_text = code_text.gsub('<path_to>', @root_test_directory) eval(code_text) end When(/^the \w+(?: \w+)?'s \w+(?: \w+)? (?:is|are) requested$/) do |code_text| @result = eval(code_text) end Given(/^a model for the following background:$/) do |gherkin_text| @models ||= [] @models << CukeModeler::Background.new(gherkin_text) end Given(/^a model for the following scenario:$/) do |gherkin_text| @models ||= [] @models << CukeModeler::Scenario.new(gherkin_text) end Given(/^a model for the following outline:$/) do |gherkin_text| @models ||= [] @models << CukeModeler::Outline.new(gherkin_text) end Given(/^a model for the following step:$/) do |gherkin_text| @models ||= [] @models << CukeModeler::Step.new(gherkin_text) end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
cuke_modeler-2.1.0 | testing/cucumber/step_definitions/modeling_steps.rb |
cuke_modeler-2.0.0 | testing/cucumber/step_definitions/modeling_steps.rb |