Class: Sus::Assertions::Assert
- Inherits:
-
Object
- Object
- Sus::Assertions::Assert
- Defined in:
- lib/sus/assertions.rb
Overview
Represents a single assertion result.
Instance Attribute Summary collapse
-
#assertions ⇒ Object
readonly
Returns the value of attribute assertions.
-
#backtrace ⇒ Object
readonly
Returns the value of attribute backtrace.
-
#identity ⇒ Object
readonly
Returns the value of attribute identity.
- #The assertions instance that contains this assertion.(assertionsinstancethatcontainsthisassertion.) ⇒ Object readonly
- #The backtrace where the assertion was made.(backtracewheretheassertionwasmade.) ⇒ Object readonly
Instance Method Summary collapse
- #each_failure {|_self| ... } ⇒ Object
-
#initialize(identity, backtrace, assertions) ⇒ Assert
constructor
Initialize a new assertion result.
- #message ⇒ Object
- #The identity of the assertion.=(identityoftheassertion. = (value)) ⇒ Object
Constructor Details
#initialize(identity, backtrace, assertions) ⇒ Assert
Initialize a new assertion result.
197 198 199 200 201 |
# File 'lib/sus/assertions.rb', line 197 def initialize(identity, backtrace, assertions) @identity = identity @backtrace = backtrace @assertions = assertions end |
Instance Attribute Details
#assertions ⇒ Object (readonly)
Returns the value of attribute assertions.
210 211 212 |
# File 'lib/sus/assertions.rb', line 210 def assertions @assertions end |
#backtrace ⇒ Object (readonly)
Returns the value of attribute backtrace.
207 208 209 |
# File 'lib/sus/assertions.rb', line 207 def backtrace @backtrace end |
#identity ⇒ Object (readonly)
Returns the value of attribute identity.
204 205 206 |
# File 'lib/sus/assertions.rb', line 204 def identity @identity end |
#The assertions instance that contains this assertion.(assertionsinstancethatcontainsthisassertion.) ⇒ Object (readonly)
210 |
# File 'lib/sus/assertions.rb', line 210 attr :assertions |
#The backtrace where the assertion was made.(backtracewheretheassertionwasmade.) ⇒ Object (readonly)
207 |
# File 'lib/sus/assertions.rb', line 207 attr :backtrace |
Instance Method Details
#each_failure {|_self| ... } ⇒ Object
213 214 215 |
# File 'lib/sus/assertions.rb', line 213 def each_failure(&block) yield self end |
#message ⇒ Object
218 219 220 221 222 223 224 |
# File 'lib/sus/assertions.rb', line 218 def { # It's possible that several Assert instances might share the same output text. This is because the output is buffered for each test and each top-level test expectation. text: @assertions.output.string, location: @identity&.to_location } end |
#The identity of the assertion.=(identityoftheassertion. = (value)) ⇒ Object
204 |
# File 'lib/sus/assertions.rb', line 204 attr :identity |