shard-spectator/spec
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
..
docs Add missing require statement 2020-05-09 14:12:40 -06:00
features Support multiple block arguments in sample block 2022-01-11 15:53:53 -07:00
helpers Spelling 2022-01-10 21:10:36 -07:00
issues Handle case with typeless block 2022-02-21 18:17:44 -07:00
matchers Support variables and methods for type matcher (be_a). 2021-04-17 09:38:29 -06:00
rspec Formatting 2022-01-07 17:27:25 -07:00
spectator Avoid issue with TypeCastError message 2022-03-16 22:40:24 -06:00
runtime_example_spec.cr Mark slow compilation tests 2021-08-18 15:57:39 -06:00
spec_helper.cr Initial work on Double 2022-03-03 22:10:09 -07:00