Class: LearnLab::Test::Runner
- Inherits:
-
Object
- Object
- LearnLab::Test::Runner
- Defined in:
- lib/learn_lab/test/runner.rb
Overview
Runs a test suite. Lifted from the ‘learn-test` gem without Ironboard related code.
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
Instance Method Summary collapse
-
#initialize(repo, options = {}) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
- #strategy ⇒ Object
- #working_directory ⇒ Object
Constructor Details
#initialize(repo, options = {}) ⇒ Runner
Returns a new instance of Runner.
11 12 13 14 |
# File 'lib/learn_lab/test/runner.rb', line 11 def initialize(repo, ={}) @repo = repo @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/learn_lab/test/runner.rb', line 9 def @options end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
9 10 11 |
# File 'lib/learn_lab/test/runner.rb', line 9 def repo @repo end |
Instance Method Details
#run ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/learn_lab/test/runner.rb', line 16 def run strategy.check_dependencies strategy.run results = strategy.results strategy.cleanup unless .fetch(:keep, false) results end |
#strategy ⇒ Object
28 29 30 31 32 33 |
# 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 ⇒ Object
24 25 26 |
# File 'lib/learn_lab/test/runner.rb', line 24 def working_directory repo.working_directory end |