Commit Graph

33 Commits

Author SHA1 Message Date
Michael Miller e6584c9f04
Prevent comparing range arguments with non-compatible types in stubs
Addresses https://github.com/icy-arctic-fox/spectator/issues/48
2022-12-18 11:35:43 -07:00
Michael Miller 4b68b8e3de
Fix resolution issue when mocked types use custom types
GitLab issue 51 is affected.
https://gitlab.com/arctic-fox/spectator/-/issues/51
Private types cannot be referenced with mocks.
2022-12-17 20:56:16 -07:00
Michael Miller 65a4b8e756
Populate previous_def/super with captured block args
The previous_def and super keywords do not propagate blocks.
See: https://github.com/crystal-lang/crystal/issues/10399
This works around the issue by populating arguments if the method uses a block.
2022-12-17 16:41:22 -07:00
Michael Miller b52593dbde
Cleanup 2022-12-17 16:39:47 -07:00
Michael Miller 952e949307
Handle 'self' and some other variants in method return types 2022-12-13 22:48:21 -07:00
Michael Miller 293faccd5c
Support free variables in mocked types 2022-12-13 18:22:22 -07:00
Michael Miller 47a62ece78
Add reduced test code for GitLab issue 80
https://gitlab.com/arctic-fox/spectator/-/issues/80
Note: This test only triggers a compiler bug when the file is compiled by itself.
Compiling/running the entire spec suite *does not* cause the bug.
2022-12-08 17:14:09 -07:00
Michael Miller fbe877690d
Adjust call argument matching
Reenable test for https://github.com/icy-arctic-fox/spectator/issues/44 and https://github.com/icy-arctic-fox/spectator/issues/47
2022-11-29 22:31:22 -07:00
Michael Miller e2130d12d3
Implement arguments case equality
Implements https://github.com/icy-arctic-fox/spectator/issues/47
Some specs are failing and need to be resolved before the new feature is considered done.
2022-10-23 20:42:08 -06:00
Michael Miller 70d0009db5
Disable issue 47 test for now 2022-10-09 18:23:39 -06:00
Michael Miller 2516803b0d
Add spec for GitHub issue 47
https://github.com/icy-arctic-fox/spectator/issues/47
2022-10-09 15:35:22 -06:00
Michael Miller 422b0efa59
Update test to account for fix in Crystal 1.6
Keyword arguments cannot be used as a short-hand for positional arguments (yet).
https://github.com/icy-arctic-fox/spectator/issues/44
2022-10-09 12:33:31 -06:00
Michael Miller 17a3ca3ac7
Fix https://gitlab.com/arctic-fox/spectator/-/issues/77 2022-08-07 14:58:09 -06:00
Michael Miller 18e9c1c35d
Workaround issue with Box.unbox causing segfault
Using Box.unbox on a nil value with a union type causes:

Invalid memory access (signal 11) at address 0x8

Related Crystal issue: https://github.com/crystal-lang/crystal/issues/11839
Fixes: https://gitlab.com/arctic-fox/spectator/-/issues/76
2022-07-18 19:47:34 -06:00
Michael Miller 95764140ee
Add spec for GitLab issue 51
https://gitlab.com/arctic-fox/spectator/-/issues/51
2022-07-14 22:01:33 -06:00
Michael Miller d14a2fa27e
Change "title" 2022-07-14 19:59:14 -06:00
Michael Miller c0a32505ee
Address Ameba issue 2022-07-14 13:53:30 -06:00
Michael Miller be973cdc4b
Add spec for GitHub issue 44
https://github.com/icy-arctic-fox/spectator/issues/44
2022-07-13 15:52:31 -06:00
Michael Miller f1465c44d8
Fix Ameba issues 2022-07-13 13:42:44 -06:00
Michael Miller da3fbc9607
Add spec for GitHub issue 43
https://github.com/icy-arctic-fox/spectator/issues/43
2022-07-13 11:17:10 -06:00
Michael Miller 754bfd6939
Intercept most exit calls and raise instead 2022-07-12 23:02:20 -06:00
Michael Miller 2e5f822e1d
Remove `new` from reserved keywords
This effectively allows stubs to be placed on the `new` method for types.
A strange issue arose when the keyword was allowed.
The compiler failed to resolve the Stub type from the Double initializer.
The error trace goes through null_double_spec.cr.
Running just that spec file confirms the issue is there, but running other individual files doesn't produce the error.
As a workaround, I've put the full path of Stub in the initializer.
2022-07-12 22:30:04 -06:00
Michael Miller 193a476679
Update known issues to use new mock system 2022-07-12 21:50:45 -06:00
Michael Miller a8e55e32d2
Works now due to lazy doubles 2022-03-30 19:13:14 -06:00
Michael Miller b83c6b7b1e
Remove or skip mock, double, and stub tests 2022-03-19 17:20:15 -06:00
Michael Miller eb8bd88927
Handle case with typeless block
Fixes syntax:
`stub method(&block)`

To stub a block with args, use:
`stub method(&block : Type -> Type)`

Addresses https://github.com/icy-arctic-fox/spectator/issues/42
2022-02-21 18:17:44 -07:00
Michael Miller 92e839415d
Fix sample iteration with single block arg (not tuple) 2022-01-26 13:14:30 -07:00
Michael Miller 7210b8e11c
Test class method usage 2021-07-10 23:04:02 -06:00
Michael Miller 766b6b17c7
Add test for https://github.com/icy-arctic-fox/spectator/issues/33 2021-07-10 22:51:47 -06:00
Michael Miller dba20757f3
Add test for https://github.com/icy-arctic-fox/spectator/issues/32 2021-07-10 22:44:43 -06:00
Michael Miller f728ab6ad7
Add test case handling NoReturn stub and top-level methods (exit)
Fixes https://github.com/icy-arctic-fox/spectator/issues/29
2021-07-02 21:55:42 -06:00
Michael Miller a0537484f4
Allow creation of doubles without a definition
Utilizes anonymous doubles to implement this.
Fixes https://github.com/icy-arctic-fox/spectator/issues/30
2021-07-02 19:18:14 -06:00
Michael Miller e3f6fb3c7c
Add no_args support for stubs
Fixes https://github.com/icy-arctic-fox/spectator/issues/28
2021-07-02 18:43:39 -06:00