Sha256: 03fff98871f2528e991d6ccfeebfea50b7d6f9fc1f7bd8e0da79209bb380be32

Contents?: true

Size: 965 Bytes

Versions: 1

Compression:

Stored size: 965 Bytes

Contents

#!/usr/bin/env ruby

$:.unshift File.dirname(__FILE__) + "/../lib"
require 'cuke_iterations'
require 'trollop'
require 'fileutils'

opts = Trollop::options do
  opt :iteration_file, "Iterations file to use", :default => 'cuke_iterations.yml'
  opt :out, "Name of runfile to write", :default => 'run.txt'
end

Trollop::die "Couldn't find iterations file '#{opts[:iteration_file]}'" unless File.exist?(opts[:iteration_file])
iterations = YAML.load(File.read(opts[:iteration_file]))

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

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

File.open(opts[:out], 'w') {|f| f.puts all_scenarios}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cuke_iterations-0.0.1 bin/cuke_iterations