Sha256: 65b0a20a90342b143daf514770d1302d18e0db00b62448efd6768f5cb8723dfe

Contents?: true

Size: 1.59 KB

Versions: 5

Compression:

Stored size: 1.59 KB

Contents

#!/usr/bin/env ruby

require 'optparse'
require_relative '../lib/learn_test'

options = {}

OptionParser.new do |opts|
  opts.banner = "Usage: learn [options]"

  opts.on("--sync", "Report test results synchronously") do |s|
    options[:sync] = s
  end

  opts.on("-d", "--debug", "Output errors during results synchronization") do |d|
    options[:debug] = d
  end

  opts.on("-n", "--[no-]color", "Turn off color output") do |c|
    options[:color] = c
  end

  opts.on("-f", "--format") do |f|
    options[:format] = f
  end

  opts.on("-l", "--local", "Don't push results to Learn") do |l|
    options[:local] = l
  end

  opts.on("-b", "--browser", "Run tests in browser") do |b|
    options[:browser] = b
  end

  opts.on("-o", "--out FILE") do |o|
    options[:out] = o
  end

  opts.on("-s", "--skip") do |s|
    options[:skip] = s
  end

  opts.on("-t", "--test") do |t|
    options[:test] = t
  end

  opts.on("-v", "--version") do |v|
    puts LearnTest::VERSION
    exit
  end

  opts.on('--keep', "Don't delete test output files") do |k|
    options[:keep] = true
  end

  opts.on('--fail-fast', 'Stop running test suite on first failed test') do |f|
    options[:fail_fast] = f
  end

  opts.on("-e", "--example STRING", "Run examples whose full nested names include STRING (may be used more than once)") do |s|
    (options[:example] ||= []) << s
  end

  if ARGV.any? { |arg| arg == "init" }
    options[:init] = true
  end

  options[:argv] = ARGV
end.parse!

repo = options[:test] ? "git@github.com:flatiron-school/a-sample-repo.git" : LearnTest::RepoParser.get_repo
LearnTest::Runner.new(repo, options).run

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
learn-test-3.1.2 bin/learn-test
learn-test-3.1.1 bin/learn-test
learn-test-3.1.0 bin/learn-test
learn-test-3.0.0 bin/learn-test
learn-test-2.7.0 bin/learn-test