Change Result to a class

This is to get around a segfault.
I'm unable to reproduce this in a simpler example at this time.
However, this can be worked around by changing from a struct to a class.

Relevant backtrace:

Invalid memory access (signal 11) at address 0x4
[0x4829f6] *CallStack::print_backtrace:Int32 +118
[0x46de7d] __crystal_sigfault_handler +61
[0x7fe6ec64b390] ???
[0x486df5] *String#==<String>:Bool +37
[0x509ac4] *Spectator::Expectations::ValueExpectationPartial(Int32) +52
[0x50a52e] *Spectator::Expectations::ValueExpectation(Int32, Int32) +94
[0x50acb2] *Spectator::Expectations::Expectation::Result +210
[0x4fcd9b] *Spectator::Expectations::ExpectationResults +635
[0x50c9eb]*Spec::ContainExpectation(Spectator::Expectations::Expectation::Result)+43
[0x4fcaea] *Spectator::Expectations::ExpectationResults +138
...
This commit is contained in:
Michael Miller 2018-10-19 13:04:51 -06:00
parent 7d08d38659
commit 0892a073fe

View file

@ -22,7 +22,7 @@ module Spectator::Expectations
end
# Information regarding the outcome of an expectation.
struct Result
class Result
# Indicates whether the expectation was satisifed or not.
getter? successful : Bool