Class: Minitest::Queue::SingleExample
- Inherits:
-
Object
- Object
- Minitest::Queue::SingleExample
- Defined in:
- lib/minitest/queue.rb
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #flaky? ⇒ Boolean
- #id ⇒ Object
-
#initialize(runnable, method_name) ⇒ SingleExample
constructor
A new instance of SingleExample.
- #run ⇒ Object
- #with_timestamps ⇒ Object
Constructor Details
#initialize(runnable, method_name) ⇒ SingleExample
Returns a new instance of SingleExample.
154 155 156 157 |
# File 'lib/minitest/queue.rb', line 154 def initialize(runnable, method_name) @runnable = runnable @method_name = method_name end |
Instance Method Details
#<=>(other) ⇒ Object
163 164 165 |
# File 'lib/minitest/queue.rb', line 163 def <=>(other) id <=> other.id end |
#flaky? ⇒ Boolean
184 185 186 |
# File 'lib/minitest/queue.rb', line 184 def flaky? Minitest.queue.flaky?(self) end |
#id ⇒ Object
159 160 161 |
# File 'lib/minitest/queue.rb', line 159 def id @id ||= "#{@runnable}##{@method_name}".freeze end |
#run ⇒ Object
178 179 180 181 182 |
# File 'lib/minitest/queue.rb', line 178 def run do Minitest.run_one_method(@runnable, @method_name) end end |
#with_timestamps ⇒ Object
167 168 169 170 171 172 173 174 175 176 |
# File 'lib/minitest/queue.rb', line 167 def = result = yield result ensure if result result. = result. = end end |