class LearnLab::Test::Runner

Runs a test suite. Lifted from the `learn-test` gem without Ironboard related code.

Attributes

options[R]
repo[R]

Public Class Methods

new(repo, options={}) click to toggle source
# File lib/learn_lab/test/runner.rb, line 11
def initialize(repo, options={})
  @repo = repo
  @options = options
end

Public Instance Methods

run() click to toggle source
# File lib/learn_lab/test/runner.rb, line 16
def run
  strategy.check_dependencies
  strategy.run
  results = strategy.results
  strategy.cleanup unless options.fetch(:keep, false)
  results
end
strategy() click to toggle source
# File lib/learn_lab/test/runner.rb, line 28
def strategy
  @strategy ||= begin
    detected = strategies.map { |s| s.new(self) }.detect(&:detect)
    detected || LearnLab::Test::Strategies::None.new(self)
  end
end
working_directory() click to toggle source
# File lib/learn_lab/test/runner.rb, line 24
def working_directory
  repo.working_directory
end

Private Instance Methods

strategies() click to toggle source
# File lib/learn_lab/test/runner.rb, line 37
def strategies
  [
    LearnLab::Test::Strategies::Mocha,
    LearnLab::Test::Strategies::Rspec
  ]
end