Sha256: 07ef34e48bb7b29d464b83d26c54deb0d6f82059fa9844e87a475c00964ab45d

Contents?: true

Size: 1.29 KB

Versions: 2

Compression:

Stored size: 1.29 KB

Contents

Then /^(?:the )?file(?: "([^"]*)")? is found to have the following properties:$/ do |file, properties|
  file ||= 1
  properties = properties.rows_hash

  properties.each do |property, expected_value|
    if property == 'path'
      expected_value.sub!('path_to', @test_directory)
    end

    expected = expected_value
    actual = @parsed_files[file - 1].send(property.to_sym).to_s

    assert(actual == expected, "Expected: #{expected}\n but was: #{actual}")
  end
end

When /^(?:the )?file(?: "([^"]*)")? features are as follows:$/ do |file, feature|
  file ||= 1

  expected = feature.raw.flatten.first
  actual = @parsed_files[file - 1].feature.name

  assert(actual == expected, "Expected: #{expected}\n but was: #{actual}")
end

When /^(?:the )?file(?: "([^"]*)")? has no features$/ do |file|
  file ||= 1

  assert @parsed_files[file - 1].feature.nil?
end

Then(/^the feature file has convenient output$/) do
  @parsed_files.first.method(:to_s).owner.should == CucumberAnalytics::FeatureFile
end

Given(/^a feature file element based on "([^"]*)"$/) do |file_name|
  file_path = "#{@default_file_directory}/#{file_name}"
  File.open(file_path, 'w') { |file| file.puts "Feature:" } unless File.exists?(file_path)

  @element = CucumberAnalytics::FeatureFile.new(file_path)
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cucumber_analytics-1.5.1 features/step_definitions/feature_file_steps.rb
cucumber_analytics-1.5.0 features/step_definitions/feature_file_steps.rb