Class: ProbeDockProbe::TestRun
- Inherits:
-
Object
- Object
- ProbeDockProbe::TestRun
- Defined in:
- lib/probe_dock_ruby/test_run.rb
Instance Attribute Summary collapse
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#project ⇒ Object
readonly
Returns the value of attribute project.
-
#results ⇒ Object
readonly
Returns the value of attribute results.
-
#uid ⇒ Object
Returns the value of attribute uid.
Instance Method Summary collapse
- #add_result(options = {}) ⇒ Object
-
#initialize(project) ⇒ TestRun
constructor
A new instance of TestRun.
- #to_h(options = {}) ⇒ Object
Constructor Details
#initialize(project) ⇒ TestRun
Returns a new instance of TestRun.
7 8 9 10 |
# File 'lib/probe_dock_ruby/test_run.rb', line 7 def initialize project @results = [] @project = project end |
Instance Attribute Details
#duration ⇒ Object
Returns the value of attribute duration.
5 6 7 |
# File 'lib/probe_dock_ruby/test_run.rb', line 5 def duration @duration end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
4 5 6 |
# File 'lib/probe_dock_ruby/test_run.rb', line 4 def project @project end |
#results ⇒ Object (readonly)
Returns the value of attribute results.
4 5 6 |
# File 'lib/probe_dock_ruby/test_run.rb', line 4 def results @results end |
#uid ⇒ Object
Returns the value of attribute uid.
5 6 7 |
# File 'lib/probe_dock_ruby/test_run.rb', line 5 def uid @uid end |
Instance Method Details
#add_result(options = {}) ⇒ Object
12 13 14 |
# File 'lib/probe_dock_ruby/test_run.rb', line 12 def add_result = {} @results << TestResult.new(@project, ) end |
#to_h(options = {}) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/probe_dock_ruby/test_run.rb', line 16 def to_h = {} validate! { 'projectId' => @project.api_id, 'version' => @project.version, 'duration' => @duration, 'results' => @results.collect{ |r| r.to_h } }.tap do |h| h['reports'] = [ { 'uid' => @uid } ] if @uid end end |