Sha256: 2efdcde9fbc1374d2d750c890093f236e87f7e2349eb92ca3e06cd3c7448dc68

Contents?: true

Size: 972 Bytes

Versions: 6

Compression:

Stored size: 972 Bytes

Contents

Given /^(?:a|the) directory "([^"]*)"$/ do |directory_name|
  @test_directory = "#{@root_test_directory}/#{directory_name}"

  FileUtils.mkdir(@test_directory) unless File.exists?(@test_directory)
end

And(/^(?:a|the) file "([^"]*)"$/) do |file_name|
  file_path = "#{@root_test_directory}/#{file_name}"

  # Some versions of Gherkin require feature content to be present in feature files
  if file_name =~ /\.feature/
    File.open(file_path, 'w') { |file|
      file.write('Feature:')
    }
  else
    FileUtils.touch(file_path)
  end
end

And(/^the file "([^"]*)":$/) do |file_name, file_text|
  file_path = "#{@root_test_directory}/#{file_name}"

  File.open(file_path, 'w') { |file| file.write(file_text) }
end

Given(/^the following gherkin:$/) do |text|
  @source_text = text
end

Given(/^a feature file with the following gherkin:$/) do |file_text|
  @file_path = CukeModeler::FileHelper.create_feature_file(:text => file_text)
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cuke_modeler-2.1.0 testing/cucumber/step_definitions/setup_steps.rb
cuke_modeler-2.0.0 testing/cucumber/step_definitions/setup_steps.rb
cuke_modeler-1.5.1 testing/cucumber/step_definitions/setup_steps.rb
cuke_modeler-1.5.0 testing/cucumber/step_definitions/setup_steps.rb
cuke_modeler-1.4.0 testing/cucumber/step_definitions/setup_steps.rb
cuke_modeler-1.3.0 testing/cucumber/step_definitions/setup_steps.rb