class Onceover::CLI::Run::Spec

Public Class Methods

command() click to toggle source
# File lib/onceover/cli/run.rb, line 37
def self.command
  @command ||= Cri::Command.define do
    name 'spec'
    usage 'spec'
    summary 'Runs spec tests'

    optional :p, :parallel, 'Runs spec tests in parallel. This increases speed at the cost of poorly formatted logs and irrelevant junit output.'
    optional nil, :format, 'Which RSpec formatter to use, valid options are: documentation, progress, FailureCollector, OnceoverFormatter. You also specify this multiple times', multiple: true, default: :defaults
    optional nil, :no_workarounds, 'Disables workarounds that have been added for convenience to get around common RSPec issues such as https://github.com/rodjek/rspec-puppet/issues/665'
    optional :ff, :fail_fast, 'Abort the run after the first failure'

    run do |opts, args, cmd|
      repo = Onceover::Controlrepo.new(opts)
      Onceover::Deploy.new.deploy_local(repo, opts)
      runner = Onceover::Runner.new(repo,Onceover::TestConfig.new(repo.onceover_yaml, opts), :spec)
      runner.prepare!
      runner.run_spec!
    end
  end
end