Class: Sus::Assertions::Error

Inherits:
Object
  • Object
show all
Defined in:
lib/sus/assertions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(identity, error) ⇒ Error

Returns a new instance of Error.



256
257
258
259
# File 'lib/sus/assertions.rb', line 256

def initialize(identity, error)
	@identity = identity
	@error = error
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



262
263
264
# File 'lib/sus/assertions.rb', line 262

def error
  @error
end

#identityObject (readonly)

Returns the value of attribute identity.



261
262
263
# File 'lib/sus/assertions.rb', line 261

def identity
  @identity
end

Instance Method Details

#each_failure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



264
265
266
# File 'lib/sus/assertions.rb', line 264

def each_failure(&block)
	yield self
end

#messageObject



268
269
270
271
272
273
# File 'lib/sus/assertions.rb', line 268

def message
	{
		text: @error.full_message,
		location: @identity&.to_location
	}
end