Class: LearnTest::Runner
- Inherits:
-
Object
- Object
- LearnTest::Runner
- Defined in:
- lib/learn_test/runner.rb
Constant Summary collapse
- SERVICE_URL =
'http://ironbroker-v2.flatironschool.com'
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.
6 7 8 9 10 |
# File 'lib/learn_test/runner.rb', line 6 def initialize(repo, = {}) @repo = repo @options = die if !strategy end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/learn_test/runner.rb', line 3 def @options end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
3 4 5 |
# File 'lib/learn_test/runner.rb', line 3 def repo @repo end |
Instance Method Details
#files ⇒ Object
22 23 24 |
# File 'lib/learn_test/runner.rb', line 22 def files @files ||= Dir.entries('.') end |
#keep_results? ⇒ Boolean
26 27 28 |
# File 'lib/learn_test/runner.rb', line 26 def keep_results? @keep_results ||= [:keep] || !!.delete('--keep') end |
#run ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/learn_test/runner.rb', line 12 def run strategy.check_dependencies strategy.configure strategy.run if !help_option_present? && strategy.push_results? push_results(strategy) end strategy.cleanup unless keep_results? end |
#strategy ⇒ Object
30 31 32 |
# File 'lib/learn_test/runner.rb', line 30 def strategy @strategy ||= strategies.map{ |s| s.new(self) }.detect(&:detect) end |