Sha256: c89a55b8dbbbaddbf402ab238e0157042ae372fa55c8f3e8b0eb48bd21b79dc0

Contents?: true

Size: 717 Bytes

Versions: 1

Compression:

Stored size: 717 Bytes

Contents

module CukeIterations
  class ScenarioFileWriter
    def write_scenarios(features_dir, iteration_file, out_file)
      iterations = YAML.load(File.read(iteration_file))

      all_scenarios = []
      features = CukeParser.parse_features(features_dir)
      iterations.each do |iteration_name, iteration|
        iteration_dir = File.join(features_dir, 'iterations', iteration_name, '..', '..')
        FileUtils.mkdir_p iteration_dir

        ScenarioListGenerator.for_iteration(features, iteration).each do |scenario|
          all_scenarios << File.join(iteration_dir, scenario[:filename] + ":#{scenario[:line]}")
        end
      end

      File.open(out_file, 'w') { |f| f.puts all_scenarios }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cuke_iterations-0.0.2 lib/cuke_iterations/scenario_file_writer.rb