Class: RSpec::Longrun::Formatter::Block
- Inherits:
-
Object
- Object
- RSpec::Longrun::Formatter::Block
- Defined in:
- lib/rspec/longrun/formatter.rb
Instance Method Summary collapse
- #finished! ⇒ Object
-
#initialize(nested = false) ⇒ Block
constructor
A new instance of Block.
- #nested! ⇒ Object
- #nested? ⇒ Boolean
- #timing ⇒ Object
Constructor Details
#initialize(nested = false) ⇒ Block
Returns a new instance of Block.
106 107 108 109 |
# File 'lib/rspec/longrun/formatter.rb', line 106 def initialize(nested = false) @began_at = Time.now @nested = nested end |
Instance Method Details
#finished! ⇒ Object
111 112 113 |
# File 'lib/rspec/longrun/formatter.rb', line 111 def finished! @finished_at = Time.now end |
#nested! ⇒ Object
120 121 122 |
# File 'lib/rspec/longrun/formatter.rb', line 120 def nested! @nested = true end |
#nested? ⇒ Boolean
124 125 126 |
# File 'lib/rspec/longrun/formatter.rb', line 124 def nested? @nested end |
#timing ⇒ Object
115 116 117 118 |
# File 'lib/rspec/longrun/formatter.rb', line 115 def timing delta = @finished_at - @began_at '%.2fs' % delta end |