Class: LearnTest::Runner
- Inherits:
-
Object
- Object
- LearnTest::Runner
- Defined in:
- lib/learn_test/runner.rb
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
- #files ⇒ Object
-
#initialize(repo, options = {}) ⇒ Runner
constructor
A new instance of Runner.
- #keep_results? ⇒ Boolean
- #run ⇒ Object
- #strategy ⇒ Object
Constructor Details
#initialize(repo, options = {}) ⇒ Runner
Returns a new instance of Runner.
9 10 11 12 |
# File 'lib/learn_test/runner.rb', line 9 def initialize(repo, = {}) @repo = repo @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/learn_test/runner.rb', line 7 def @options end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
7 8 9 |
# File 'lib/learn_test/runner.rb', line 7 def repo @repo end |
Instance Method Details
#files ⇒ Object
27 28 29 |
# File 'lib/learn_test/runner.rb', line 27 def files @files ||= Dir.entries('.') end |
#keep_results? ⇒ Boolean
31 32 33 |
# File 'lib/learn_test/runner.rb', line 31 def keep_results? @keep_results ||= [:keep] || !!.delete('--keep') end |
#run ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/learn_test/runner.rb', line 14 def run strategy.check_dependencies strategy.configure strategy.run if [:debug] || [:sync] report_and_clean else Process.detach(Process.fork do report_and_clean end) end end |
#strategy ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/learn_test/runner.rb', line 35 def strategy return @strategy if @strategy detected = strategies.map { |s| s.new(self) }.detect(&:detect) @strategy = detected || LearnTest::Strategies::None.new(self) end |