Class: Minitest::Colorin::TestID
- Inherits:
-
Object
- Object
- Minitest::Colorin::TestID
- Defined in:
- lib/minitest/colorin.rb
Constant Summary collapse
- REGEXP =
/test_(?<number>\d{4})_(?<name>.+)?/
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
Instance Method Summary collapse
-
#initialize(result) ⇒ TestID
constructor
A new instance of TestID.
Constructor Details
#initialize(result) ⇒ TestID
13 14 15 16 17 18 |
# File 'lib/minitest/colorin.rb', line 13 def initialize(result) @context = result.class.name.gsub('::', ' > ') match = result.name.match REGEXP @name = match[:name] ? match[:name].strip : 'anonymous' @number = match[:number] end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
11 12 13 |
# File 'lib/minitest/colorin.rb', line 11 def context @context end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'lib/minitest/colorin.rb', line 11 def name @name end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
11 12 13 |
# File 'lib/minitest/colorin.rb', line 11 def number @number end |