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.
153 154 155 156 |
# File 'lib/minitest/queue.rb', line 153 def initialize(runnable, method_name) @runnable = runnable @method_name = method_name end |
Instance Method Details
#<=>(other) ⇒ Object
162 163 164 |
# File 'lib/minitest/queue.rb', line 162 def <=>(other) id <=> other.id end |
#flaky? ⇒ Boolean
183 184 185 |
# File 'lib/minitest/queue.rb', line 183 def flaky? Minitest.queue.flaky?(self) end |
#id ⇒ Object
158 159 160 |
# File 'lib/minitest/queue.rb', line 158 def id @id ||= "#{@runnable}##{@method_name}" end |
#run ⇒ Object
177 178 179 180 181 |
# File 'lib/minitest/queue.rb', line 177 def run do Minitest.run_one_method(@runnable, @method_name) end end |
#with_timestamps ⇒ Object
166 167 168 169 170 171 172 173 174 175 |
# File 'lib/minitest/queue.rb', line 166 def = result = yield result ensure if result result. = result. = end end |