Class: Sweet::Run
- Inherits:
-
Object
- Object
- Sweet::Run
- Defined in:
- lib/sweet/run.rb
Instance Attribute Summary collapse
-
#category ⇒ Object
Returns the value of attribute category.
-
#description ⇒ Object
Returns the value of attribute description.
-
#failed ⇒ Object
Returns the value of attribute failed.
-
#name ⇒ Object
Returns the value of attribute name.
-
#passed ⇒ Object
Returns the value of attribute passed.
-
#pending ⇒ Object
Returns the value of attribute pending.
-
#skipped ⇒ Object
Returns the value of attribute skipped.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#tests ⇒ Object
Returns the value of attribute tests.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
Instance Method Summary collapse
- #duration ⇒ Object
-
#initialize(opts = {}) ⇒ Run
constructor
A new instance of Run.
- #total_failed ⇒ Object
- #total_passed ⇒ Object
- #total_pending ⇒ Object
- #total_skipped ⇒ Object
- #total_tests ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Run
Returns a new instance of Run.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/sweet/run.rb', line 6 def initialize(opts = {}) @name = opts[:name] @category = opts[:category] @description = opts[:description] @tags = opts[:tags] || [] @duration = 0.0 @timestamp = opts[:timestamp] || Time.now @tests = [] @passed = [] @failed = [] @skipped = [] @pending = [] organize_tests opts[:tests] || [] end |
Instance Attribute Details
#category ⇒ Object
Returns the value of attribute category.
3 4 5 |
# File 'lib/sweet/run.rb', line 3 def category @category end |
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/sweet/run.rb', line 3 def description @description end |
#failed ⇒ Object
Returns the value of attribute failed.
4 5 6 |
# File 'lib/sweet/run.rb', line 4 def failed @failed end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/sweet/run.rb', line 3 def name @name end |
#passed ⇒ Object
Returns the value of attribute passed.
4 5 6 |
# File 'lib/sweet/run.rb', line 4 def passed @passed end |
#pending ⇒ Object
Returns the value of attribute pending.
4 5 6 |
# File 'lib/sweet/run.rb', line 4 def pending @pending end |
#skipped ⇒ Object
Returns the value of attribute skipped.
4 5 6 |
# File 'lib/sweet/run.rb', line 4 def skipped @skipped end |
#tags ⇒ Object
Returns the value of attribute tags.
3 4 5 |
# File 'lib/sweet/run.rb', line 3 def @tags end |
#tests ⇒ Object
Returns the value of attribute tests.
4 5 6 |
# File 'lib/sweet/run.rb', line 4 def tests @tests end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
3 4 5 |
# File 'lib/sweet/run.rb', line 3 def @timestamp end |
Instance Method Details
#duration ⇒ Object
23 24 25 |
# File 'lib/sweet/run.rb', line 23 def duration @duration / 1_000_000_000 # nanoseconds end |
#total_failed ⇒ Object
35 36 37 |
# File 'lib/sweet/run.rb', line 35 def total_failed @failed.count end |
#total_passed ⇒ Object
31 32 33 |
# File 'lib/sweet/run.rb', line 31 def total_passed @passed.count end |
#total_pending ⇒ Object
43 44 45 |
# File 'lib/sweet/run.rb', line 43 def total_pending @pending.count end |
#total_skipped ⇒ Object
39 40 41 |
# File 'lib/sweet/run.rb', line 39 def total_skipped @skipped.count end |
#total_tests ⇒ Object
27 28 29 |
# File 'lib/sweet/run.rb', line 27 def total_tests @tests.count end |