Class: Minitest::Covers::ExampleAdapter
- Inherits:
-
Object
- Object
- Minitest::Covers::ExampleAdapter
- Defined in:
- lib/minitest/covers.rb
Instance Attribute Summary collapse
-
#full_description ⇒ Object
readonly
Returns the value of attribute full_description.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
Instance Method Summary collapse
- #exception ⇒ Object
- #id ⇒ Object
-
#initialize(test) ⇒ ExampleAdapter
constructor
A new instance of ExampleAdapter.
Constructor Details
#initialize(test) ⇒ ExampleAdapter
Returns a new instance of ExampleAdapter.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/minitest/covers.rb', line 11 def initialize(test) @test = test file, line = source_location @metadata = test.class.(test.name).merge( id: id, file_path: file, line_number: line ) @full_description = "#{test.class}##{test.name}" end |
Instance Attribute Details
#full_description ⇒ Object (readonly)
Returns the value of attribute full_description.
9 10 11 |
# File 'lib/minitest/covers.rb', line 9 def full_description @full_description end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
9 10 11 |
# File 'lib/minitest/covers.rb', line 9 def @metadata end |
Instance Method Details
#exception ⇒ Object
26 27 28 |
# File 'lib/minitest/covers.rb', line 26 def exception @test.failures.first if @test.respond_to?(:failures) end |
#id ⇒ Object
22 23 24 |
# File 'lib/minitest/covers.rb', line 22 def id "#{@test.class}##{@test.name}" end |