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.
-
#runnable ⇒ Object
readonly
Returns the value of attribute runnable.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #flaky? ⇒ Boolean
- #id ⇒ Object
-
#initialize(runnable, method_name) ⇒ SingleExample
constructor
A new instance of SingleExample.
- #run ⇒ Object
- #source_location ⇒ Object
- #with_timestamps ⇒ Object
Constructor Details
#initialize(runnable, method_name) ⇒ SingleExample
Returns a new instance of SingleExample.
226 227 228 229 |
# File 'lib/minitest/queue.rb', line 226 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.
224 225 226 |
# File 'lib/minitest/queue.rb', line 224 def method_name @method_name end |
#runnable ⇒ Object (readonly)
Returns the value of attribute runnable.
224 225 226 |
# File 'lib/minitest/queue.rb', line 224 def runnable @runnable end |
Instance Method Details
#<=>(other) ⇒ Object
235 236 237 |
# File 'lib/minitest/queue.rb', line 235 def <=>(other) id <=> other.id end |
#flaky? ⇒ Boolean
256 257 258 |
# File 'lib/minitest/queue.rb', line 256 def flaky? Minitest.queue.flaky?(self) end |
#id ⇒ Object
231 232 233 |
# File 'lib/minitest/queue.rb', line 231 def id @id ||= "#{@runnable}##{@method_name}".freeze end |
#run ⇒ Object
250 251 252 253 254 |
# File 'lib/minitest/queue.rb', line 250 def run do Minitest.run_one_method(@runnable, @method_name) end end |
#source_location ⇒ Object
260 261 262 263 264 |
# File 'lib/minitest/queue.rb', line 260 def source_location @runnable.instance_method(@method_name).source_location rescue NameError, NoMethodError nil end |
#with_timestamps ⇒ Object
239 240 241 242 243 244 245 246 247 248 |
# File 'lib/minitest/queue.rb', line 239 def = result = yield result ensure if result result. = result. = end end |