Class: RSpec::Hermetic::Minitest::Example
- Inherits:
-
Object
- Object
- RSpec::Hermetic::Minitest::Example
- Defined in:
- lib/rspec/hermetic/minitest.rb
Instance Attribute Summary collapse
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
-
#full_description ⇒ Object
readonly
Returns the value of attribute full_description.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
Instance Method Summary collapse
-
#initialize(test, block) ⇒ Example
constructor
A new instance of Example.
- #reporter ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(test, block) ⇒ Example
Returns a new instance of Example.
19 20 21 22 23 24 25 |
# File 'lib/rspec/hermetic/minitest.rb', line 19 def initialize(test, block) @test = test @block = block @metadata = {} @full_description = "#{test.class}##{test.name}" @location = source_location(test) end |
Instance Attribute Details
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
17 18 19 |
# File 'lib/rspec/hermetic/minitest.rb', line 17 def exception @exception end |
#full_description ⇒ Object (readonly)
Returns the value of attribute full_description.
17 18 19 |
# File 'lib/rspec/hermetic/minitest.rb', line 17 def full_description @full_description end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
17 18 19 |
# File 'lib/rspec/hermetic/minitest.rb', line 17 def location @location end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
17 18 19 |
# File 'lib/rspec/hermetic/minitest.rb', line 17 def @metadata end |
Instance Method Details
#reporter ⇒ Object
36 37 38 |
# File 'lib/rspec/hermetic/minitest.rb', line 36 def reporter nil end |
#run ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/rspec/hermetic/minitest.rb', line 27 def run result = @block.call @exception = result.failures.first if result.respond_to?(:failures) && result.failures.any? result rescue StandardError => error @exception = error raise end |