Class: Sus::Assertions::Assert
- Inherits:
-
Object
- Object
- Sus::Assertions::Assert
- Defined in:
- lib/sus/assertions.rb
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.
Instance Method Summary collapse
- #each_failure {|_self| ... } ⇒ Object
-
#initialize(identity, backtrace, assertions) ⇒ Assert
constructor
A new instance of Assert.
- #message ⇒ Object
Constructor Details
#initialize(identity, backtrace, assertions) ⇒ Assert
Returns a new instance of Assert.
163 164 165 166 167 |
# File 'lib/sus/assertions.rb', line 163 def initialize(identity, backtrace, assertions) @identity = identity @backtrace = backtrace @assertions = assertions end |
Instance Attribute Details
#assertions ⇒ Object (readonly)
Returns the value of attribute assertions.
171 172 173 |
# File 'lib/sus/assertions.rb', line 171 def assertions @assertions end |
#backtrace ⇒ Object (readonly)
Returns the value of attribute backtrace.
170 171 172 |
# File 'lib/sus/assertions.rb', line 170 def backtrace @backtrace end |
#identity ⇒ Object (readonly)
Returns the value of attribute identity.
169 170 171 |
# File 'lib/sus/assertions.rb', line 169 def identity @identity end |
Instance Method Details
#each_failure {|_self| ... } ⇒ Object
173 174 175 |
# File 'lib/sus/assertions.rb', line 173 def each_failure(&block) yield self end |
#message ⇒ Object
177 178 179 180 181 182 183 |
# File 'lib/sus/assertions.rb', line 177 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 |