Sha256: c9eb05a65d983b9ae1830105a4e3eac42c3fc6660e0965b318589b7c284bb93d

Contents?: true

Size: 1.3 KB

Versions: 9

Compression:

Stored size: 1.3 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.gsub!('<source_text>', "'#{@source_text}'")

  eval(code_text)
end

Given(/^(?:a|the) (?:directory|feature file) is modeled$/) do |code_text|
  code_text.gsub!('<path_to>', @default_file_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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
cuke_modeler-1.2.1 testing/cucumber/step_definitions/modeling_steps.rb
cuke_modeler-1.2.0 testing/cucumber/step_definitions/modeling_steps.rb
cuke_modeler-1.1.1 testing/cucumber/step_definitions/modeling_steps.rb
cuke_modeler-1.1.0 testing/cucumber/step_definitions/modeling_steps.rb
cuke_modeler-1.0.4 testing/cucumber/step_definitions/modeling_steps.rb
cuke_modeler-1.0.3 testing/cucumber/step_definitions/modeling_steps.rb
cuke_modeler-1.0.2 testing/cucumber/step_definitions/modeling_steps.rb
cuke_modeler-1.0.1 features/step_definitions/modeling_steps.rb
cuke_modeler-1.0.0 features/step_definitions/modeling_steps.rb