Sha256: 70d0f6b153150cfab96721deda2b6dd88dc47a66317acdf8a2279e614b991e66

Contents?: true

Size: 1.62 KB

Versions: 20

Compression:

Stored size: 1.62 KB

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

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

20 entries across 20 versions & 1 rubygems

Version Path
learn-test-3.3.1 bin/learn-test
learn-test-3.3.0 bin/learn-test
learn-test-3.3.0.pre.6 bin/learn-test
learn-test-3.3.0.pre.5 bin/learn-test
learn-test-3.3.0.pre.4 bin/learn-test
learn-test-3.3.0.pre.3 bin/learn-test
learn-test-3.3.0.pre.2 bin/learn-test
learn-test-3.3.0.pre.1 bin/learn-test
learn-test-3.2.4 bin/learn-test
learn-test-3.2.3 bin/learn-test
learn-test-3.2.2 bin/learn-test
learn-test-3.2.1 bin/learn-test
learn-test-3.2.1.pre.7 bin/learn-test
learn-test-3.2.1.pre.6 bin/learn-test
learn-test-3.2.1.pre.5 bin/learn-test
learn-test-3.2.1.pre.4 bin/learn-test
learn-test-3.2.1.pre.3 bin/learn-test
learn-test-3.2.1.pre.2 bin/learn-test
learn-test-3.2.1.pre.1 bin/learn-test
learn-test-3.2.0 bin/learn-test