shard-spectator/spec/spectator
Michael Miller 4f7a4a3453
Avoid issue with TypeCastError message
For some reason, attempting to get the class of the stubbed value causes a segfault.
This appears to get swallowed in some cases.
Trying to inspect the value was difficult without triggering some error.
In the failing case, the value is 42 (returned by a stubbed foo method).
The method is supposed to return a String, and this error checking should be triggered (line 119).
The value is a union, and inspecting the bytes contained in it looks like it's prefixed with the Crystal type ID for Int32.
However it looks like Crystal tries to treat it as a Bool? I'm not sure.
Very weird behavior and instead of wasting more time on it, I'm omitting the returned type from the error.
This type of casting error shouldn't be common.
This seems like a Crystal bug, but I'm having a hard time distilling the issue.
2022-03-16 22:40:24 -06:00
..
mocks Avoid issue with TypeCastError message 2022-03-16 22:40:24 -06:00
anything_spec.cr Change Anything to only use case equality 2021-02-09 21:18:20 -07:00
block_spec.cr Test value types 2021-02-09 22:50:21 -07:00
lazy_spec.cr Avoid using subject with structs 2021-02-13 17:33:52 -07:00
lazy_wrapper_spec.cr Test value types 2021-02-09 22:50:21 -07:00
value_spec.cr Use cast as workaround 2021-02-13 11:44:51 -07:00
wrapper_spec.cr Add specs for value types 2021-02-13 13:30:05 -07:00