Sha256: c7bfccc473541b64dc3c592f320a7392cbaf9c5e27dbbbf5029dbe3c6a4c4aa1

Contents?: true

Size: 1.3 KB

Versions: 2

Compression:

Stored size: 1.3 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
  expect(@parsed_files.first.method(:to_s).owner).to eq(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.6.0 testing/cucumber/step_definitions/feature_file_steps.rb
cucumber_analytics-1.5.2 features/step_definitions/feature_file_steps.rb