Class: Neospec::Spec::Result
- Inherits:
-
Object
- Object
- Neospec::Spec::Result
- Defined in:
- lib/neospec/spec/result.rb,
lib/neospec/spec/result/failure.rb
Defined Under Namespace
Classes: Failure
Instance Attribute Summary collapse
-
#expectations ⇒ Object
Returns the value of attribute expectations.
-
#failures ⇒ Object
Returns the value of attribute failures.
-
#finish ⇒ Object
Returns the value of attribute finish.
-
#start ⇒ Object
Returns the value of attribute start.
Instance Method Summary collapse
- #duration ⇒ Object
- #finish! ⇒ Object
-
#initialize ⇒ Result
constructor
A new instance of Result.
- #start! ⇒ Object
- #successful? ⇒ Boolean
Constructor Details
#initialize ⇒ Result
Returns a new instance of Result.
6 7 8 9 10 11 |
# File 'lib/neospec/spec/result.rb', line 6 def initialize @expectations = 0 @failures = [] @start = nil @finish = nil end |
Instance Attribute Details
#expectations ⇒ Object
Returns the value of attribute expectations.
4 5 6 |
# File 'lib/neospec/spec/result.rb', line 4 def expectations @expectations end |
#failures ⇒ Object
Returns the value of attribute failures.
4 5 6 |
# File 'lib/neospec/spec/result.rb', line 4 def failures @failures end |
#finish ⇒ Object
Returns the value of attribute finish.
4 5 6 |
# File 'lib/neospec/spec/result.rb', line 4 def finish @finish end |
#start ⇒ Object
Returns the value of attribute start.
4 5 6 |
# File 'lib/neospec/spec/result.rb', line 4 def start @start end |
Instance Method Details
#duration ⇒ Object
25 26 27 28 |
# File 'lib/neospec/spec/result.rb', line 25 def duration return if @start.nil? || @finish.nil? @finish - @start end |
#finish! ⇒ Object
21 22 23 |
# File 'lib/neospec/spec/result.rb', line 21 def finish! @finish = Time.now end |
#start! ⇒ Object
17 18 19 |
# File 'lib/neospec/spec/result.rb', line 17 def start! @start = Time.now end |
#successful? ⇒ Boolean
13 14 15 |
# File 'lib/neospec/spec/result.rb', line 13 def successful? @failures.empty? end |