Sha256: 7d4ac1733aecf3eadb5e450a568abf1e28f341f449750fe7b2035fd23b559d53

Contents?: true

Size: 1.81 KB

Versions: 2

Compression:

Stored size: 1.81 KB

Contents

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

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

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

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

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

  actual_files = @parsed_directories[directory - 1].feature_files.collect { |file| file.name }

  assert actual_files.flatten.sort == files.raw.flatten.sort
end

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

  expected = directories.raw.flatten.sort
  actual = @parsed_directories[directory - 1].directories.collect { |sub_directory| sub_directory.name }

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

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

  expected = []
  actual = @parsed_directories[directory - 1].directories

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

Given(/^a directory element based on "([^"]*)"$/) do |directory_name|
  directory_path = "#{@default_file_directory}/#{directory_name}"
  FileUtils.mkdir(directory_path) unless File.exists?(directory_path)

  @element = CucumberAnalytics::Directory.new(directory_path)
end

Then(/^the directory has convenient output$/) do
  expect(@parsed_directories.first.method(:to_s).owner).to eq(CucumberAnalytics::Directory)
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cucumber_analytics-1.6.0 testing/cucumber/step_definitions/directory_steps.rb
cucumber_analytics-1.5.2 features/step_definitions/directory_steps.rb