Sha256: ef33b38fcca1d50801ec0b487d1c3b608120a07adc339564e80d107feceac459

Contents?: true

Size: 1.69 KB

Versions: 7

Compression:

Stored size: 1.69 KB

Contents

Given /^the following(?: feature)? file(?: "([^"]*)")?:$/ do |file_name, file_text|
  @test_directory ||= @default_file_directory
  file_name ||= @default_feature_file_name

  File.open("#{@test_directory}/#{file_name}", 'w') { |file|
    file.write(file_text)
  }
end

When /^the file(?: "([^"]*)")? is read$/ do |file_name|
  @parsed_files ||= []
  @test_directory ||= @default_file_directory
  file_name ||= @default_feature_file_name

  @parsed_files << CukeModeler::FeatureFile.new("#{@test_directory}/#{file_name}")
end

When /^the step definition file "([^"]*)" is read$/ do |file_name|
  @test_directory ||= @default_file_directory
  file_name ||= @default_step_file_name

  CukeModeler::World.load_step_file("#{@test_directory}/#{file_name}")
end

When /^parameter delimiters of "([^"]*)" and "([^"]*)"$/ do |left_delimiter, right_delimiter|
  CukeModeler::World.left_delimiter = left_delimiter
  CukeModeler::World.right_delimiter = right_delimiter
end

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

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

When /^the directory(?: "([^"]*)")? is read$/ do |directory_name|
  @parsed_directories ||= []
  @test_directory = "#{@default_file_directory}/#{directory_name}" if directory_name

  @parsed_directories << CukeModeler::Directory.new(@test_directory)
end

When /^the following step definition file(?: "([^"]*)")?:$/ do |file_name, file_text|
  @test_directory ||= @default_file_directory
  file_name ||= @default_step_file_name

  File.open("#{@test_directory}/#{file_name}", 'w') { |file|
    file.write(file_text)
  }
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cuke_modeler-0.4.1 features/step_definitions/setup_steps.rb
cuke_modeler-0.4.0 features/step_definitions/setup_steps.rb
cuke_modeler-0.3.0 features/step_definitions/setup_steps.rb
cuke_modeler-0.2.0 features/step_definitions/setup_steps.rb
cuke_modeler-0.1.0 features/step_definitions/setup_steps.rb
cuke_modeler-0.0.2 features/step_definitions/setup_steps.rb
cuke_modeler-0.0.1 features/step_definitions/setup_steps.rb