Sha256: 95820c4ec451a2aca4db89502a48ca197ad3123f217e0234511c1ace1bc8ebd1

Contents?: true

Size: 964 Bytes

Versions: 1

Compression:

Stored size: 964 Bytes

Contents

#!/usr/bin/env ruby

require 'rubygems'
require 'ginger'
require 'rake'

if ARGV.length == 0
  puts <<-USAGE
ginger #{Ginger::Version::String}
Use ginger to run specs for each scenario defined. Scenarios must be set out in
a file called ginger_scenarios.rb wherever this tool is run. Once they're
defined, then you can run this tool and provide the rake task that would
normally be called.

Examples:
  ginger spec
  ginger test
  ginger spec:models
USAGE
  exit 0
end

file_path = File.join Dir.pwd, ".ginger"

File.delete(file_path) if File.exists?(file_path)

scenarios = Ginger::Configuration.instance.scenarios
puts "No Ginger Scenarios defined" if scenarios.empty?

scenarios.each_with_index do |scenario, index|
  puts <<-SCENARIO

-------------------
Ginger Scenario #{index+1}
-------------------
  SCENARIO
  
  File.open('.ginger', 'w') { |f| f.write index.to_s }
  system("rake #{ARGV.join(" ")}")
end

File.delete(file_path) if File.exists?(file_path)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
freelancing-god-ginger-1.0.0 bin/ginger