Sha256: 058aef4114f5c90aca1b7a3bf6d3f1a0f0135a5ccf2817ad374d3a0f3d68afb9

Contents?: true

Size: 1.56 KB

Versions: 1

Compression:

Stored size: 1.56 KB

Contents

Given(/^a directory "([^"]*)"$/) do |partial_directory_path|
  directory_path = partial_directory_path.include?('path/to') ? process_path(partial_directory_path) : "#{@default_file_directory}/#{partial_directory_path}"

  FileUtils.mkpath(directory_path) unless File.exists?(directory_path)
end

And(/^a file "([^"]*)":$/) do |partial_file_path, file_text|
  File.open("#{@default_file_directory}/#{partial_file_path}", 'w') { |file| file.write file_text }
end

And(/^a repository is made from "([^"]*)"$/) do |partial_path|
  repo_path = "#{@default_file_directory}/#{partial_path}"

  @repository = CQL::Repository.new(repo_path)
end

Given(/^the models provided by CukeModeler$/) do
  @available_model_classes = Array.new.tap do |classes|
    CukeModeler.constants.each do |constant|
      if CukeModeler.const_get(constant).is_a?(Class)
        classes << CukeModeler.const_get(constant) if CukeModeler.const_get(constant).ancestors.include?(CukeModeler::Model)
      end
    end
  end
end

Given(/^a repository to query$/) do
  @root_directory_model = CukeModeler::Directory.new
  @repository = CQL::Repository.new(@root_directory_model)
end

And(/^the following feature has been modeled in the repository:$/) do |text|
  file_model = CukeModeler::FeatureFile.new

  # CukeModeler::FeatureFile had a different interface in 0.x
  if file_model.respond_to?(:feature=)
    file_model.feature = CukeModeler::Feature.new(text)
  else
    file_model.features << CukeModeler::Feature.new(text)
  end

  @root_directory_model.feature_files << file_model
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cql-1.4.0 testing/cucumber/step_definitions/setup_steps.rb