Sha256: 5270abb3851b82c0c6d370d200a33486290be4f3f754f2baeeea1b8189f69af2

Contents?: true

Size: 1.72 KB

Versions: 11

Compression:

Stored size: 1.72 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 << CucumberAnalytics::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

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

When /^parameter delimiters of "([^"]*)" and "([^"]*)"$/ do |left_delimiter, right_delimiter|
  CucumberAnalytics::World.left_delimiter = left_delimiter
  CucumberAnalytics::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 << CucumberAnalytics::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

11 entries across 11 versions & 1 rubygems

Version Path
cucumber_analytics-1.6.0 testing/cucumber/step_definitions/setup_steps.rb
cucumber_analytics-1.5.2 features/step_definitions/setup_steps.rb
cucumber_analytics-1.5.1 features/step_definitions/setup_steps.rb
cucumber_analytics-1.5.0 features/step_definitions/setup_steps.rb
cucumber_analytics-1.4.2 features/step_definitions/setup_steps.rb
cucumber_analytics-1.4.1 features/step_definitions/setup_steps.rb
cucumber_analytics-1.4.0 features/step_definitions/setup_steps.rb
cucumber_analytics-1.3.0 features/step_definitions/setup_steps.rb
cucumber_analytics-1.2.0 features/step_definitions/setup_steps.rb
cucumber_analytics-1.1.1 features/step_definitions/setup_steps.rb
cucumber_analytics-1.0.0 features/step_definitions/setup_steps.rb