Class: Minitest::Queue::SingleExample
- Inherits:
-
Object
- Object
- Minitest::Queue::SingleExample
- Defined in:
- lib/minitest/queue.rb
Instance Attribute Summary collapse
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
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.
155 156 157 158 |
# File 'lib/minitest/queue.rb', line 155 def initialize(runnable, method_name) @runnable = runnable @method_name = method_name end |
Instance Attribute Details
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
153 154 155 |
# File 'lib/minitest/queue.rb', line 153 def method_name @method_name end |
Instance Method Details
#<=>(other) ⇒ Object
164 165 166 |
# File 'lib/minitest/queue.rb', line 164 def <=>(other) id <=> other.id end |
#flaky? ⇒ Boolean
185 186 187 |
# File 'lib/minitest/queue.rb', line 185 def flaky? Minitest.queue.flaky?(self) end |
#id ⇒ Object
160 161 162 |
# File 'lib/minitest/queue.rb', line 160 def id @id ||= "#{@runnable}##{@method_name}".freeze end |
#run ⇒ Object
179 180 181 182 183 |
# File 'lib/minitest/queue.rb', line 179 def run do Minitest.run_one_method(@runnable, @method_name) end end |
#with_timestamps ⇒ Object
168 169 170 171 172 173 174 175 176 177 |
# File 'lib/minitest/queue.rb', line 168 def = result = yield result ensure if result result. = result. = end end |