Commit graph

2241 commits

Author SHA1 Message Date
Michael Miller
4020bad725
Use new mock DSL 2024-05-16 21:22:11 -06:00
Michael Miller
2bb9fe8dcd
Use new mock DSL 2024-05-16 21:02:14 -06:00
Michael Miller
678f85eac1
Enable Mocks for tests 2024-05-16 21:01:50 -06:00
Michael Miller
48a8408930
Use Mocks DSL 2024-05-16 21:01:18 -06:00
Michael Miller
e5fb4de4ae
Remove unused specs
These use types that no longer exist.
The underlying types are in the Mocks shard and are tested there.
2024-05-16 21:00:35 -06:00
Michael Miller
f81350a1fc
Expand compatible Crystal version range 2024-05-16 20:59:29 -06:00
Michael Miller
4148b80e58
Merge remote-tracking branch 'origin/master' into mock-redesign 2024-03-13 21:44:41 -06:00
Michael Miller
287758e6af
Update README to point at v0.12.0 2024-02-03 08:05:02 -07:00
Michael Miller
f39ceb8eba
Release v0.12.0 2024-02-03 07:56:57 -07:00
Michael Miller
9b1d400ee1
Update CHANGELOG 2024-01-27 11:29:11 -07:00
Michael Miller
edb20e5b2f
Additional handling when comparing ranges against unexpected types 2024-01-27 11:25:59 -07:00
Michael Miller
526a998e41
Shorten compare_values case statements 2024-01-27 11:25:25 -07:00
Michael Miller
556d4783bf
Support case equality of tuples, arrays, named tuples, and hashes in stub argument matching 2024-01-27 11:18:10 -07:00
Michael Miller
b5fbc96195
Allow matchers to be used in case equality 2024-01-27 11:17:19 -07:00
Michael Miller
5520999b6d
Add spec for GitHub issue 55
https://github.com/icy-arctic-fox/spectator/issues/55
2024-01-27 11:16:57 -07:00
Michael Miller
d74a772f43
WIP replace mocks with Mocks shard 2023-12-26 18:46:19 -07:00
Michael Miller
0e3f626932
Specify Crystal version range 2023-10-17 17:09:09 -06:00
Michael Miller
d45d5d4479
Bump Ameba version to 1.5 2023-10-17 17:08:58 -06:00
Michael Miller
4a630b1ebf
Bump version to v0.11.7 2023-10-16 17:34:49 -06:00
Michael Miller
d72895fe10
Merge branch 'stufro-fix-readme-mocking-example' 2023-05-21 09:58:19 -06:00
Stuart Frost
04f151fddf Fix mocking example in README.md 2023-05-19 19:39:22 +01:00
Michael Miller
9cbb5d2cf7
Workaround issue using Box with union
Addresses issue found relating to https://gitlab.com/arctic-fox/spectator/-/issues/81
See https://github.com/crystal-lang/crystal/issues/11839
2023-03-27 18:37:50 -06:00
Mike Miller
3852606b28 Merge branch 'gh-49' into 'master'
Fix splat argument expansion in method redefinition

See merge request arctic-fox/spectator!36
2023-01-27 00:28:42 +00:00
Michael Miller
726a2e1515
Add non-captured block argument
Preparing for Crystal 1.8.0
https://github.com/crystal-lang/crystal/issues/8764
2023-01-26 17:19:31 -07:00
Michael Miller
5c08427ca0
Add utility script to run nightly spec 2023-01-26 16:43:19 -07:00
Michael Miller
735122a94b
Bump v0.11.6 2023-01-26 16:21:33 -07:00
Michael Miller
9ea5c261b1
Add entry for GitHub issue 49
https://github.com/icy-arctic-fox/spectator/issues/49
2023-01-26 16:19:55 -07:00
Michael Miller
24a860ea11
Add reference to new issue
https://github.com/icy-arctic-fox/spectator/issues/51
2023-01-26 16:18:26 -07:00
Michael Miller
528ad7257d
Disable GitHub issue 49 spec for now 2023-01-26 16:17:29 -07:00
Michael Miller
7149ef7df5
Revert "Compiler bug when using unsafe_as"
This reverts commit cb89589155.
2023-01-26 16:12:54 -07:00
Michael Miller
cb89589155
Compiler bug when using unsafe_as 2023-01-25 16:09:16 -07:00
Michael Miller
a5e8f11e11
Store type to reduce a bit of bloat 2023-01-23 16:02:30 -07:00
Michael Miller
abbd6ffd71
Fix splat argument expansion in method redefinition
The constructed previous_def call was malformed for stub methods.
Resolves the original issue in
https://github.com/icy-arctic-fox/spectator/issues/49
2023-01-23 11:55:52 -07:00
Michael Miller
fd372226ab
Revert "Use separate context for example name interpolation"
This reverts commit d46698d81a.
2022-12-21 18:51:09 -07:00
Michael Miller
6a5e5b8f7a
Catch errors while evaluating node labels 2022-12-20 21:40:47 -07:00
Michael Miller
4a0bfc1cb2
Add smoke tag 2022-12-20 20:52:01 -07:00
Michael Miller
d46698d81a
Use separate context for example name interpolation
This simplifies some code.
2022-12-20 20:43:47 -07:00
Michael Miller
8c3900adcb
Add support for interpolation in context names 2022-12-20 20:32:40 -07:00
Michael Miller
30602663fe
Add tests for interpolated labels
The context label test intentionally fails.
This functionality still needs to be implemented.
2022-12-20 20:12:58 -07:00
Michael Miller
b8901f522a
Remove unnecessary cast 2022-12-20 20:11:09 -07:00
Michael Miller
c4bcf54b98
Support casting types with should statements 2022-12-19 22:40:55 -07:00
Michael Miller
acf810553a
Use location of the 'should' keyword for their expectation 2022-12-19 22:27:58 -07:00
Michael Miller
faff2933e6
Only capture splat if it has a name 2022-12-19 22:15:53 -07:00
Michael Miller
0f8c46d6ef
Support casting types with expect statements 2022-12-19 21:29:21 -07:00
Michael Miller
7620f58fb8
Test file, please ignore 2022-12-19 02:31:12 -07:00
Michael Miller
feaf1c6015
Bump version to 0.11.5 2022-12-18 19:15:25 -07:00
Michael Miller
8f80b10fc1
Support injecting mock functionality into modules
Add mock registry for a single module.
2022-12-18 19:04:50 -07:00
Michael Miller
a3c55dfa47
Add tests for module mocks docs 2022-12-18 18:52:08 -07:00
Michael Miller
fa99987780
Support creating instances of mocked modules via class
This is a bit of a hack.
The `.new` method is added to the module, which creates an instance that includes the mocked module.
No changes to the def_mock and new_mock methods are necessary.

For some reason, infinite recursion occurs when calling `.new` on the class.
To get around the issue for now, the internal method of allocation is used.
That is, allocate + initialize.
2022-12-18 16:04:49 -07:00
Michael Miller
d378583054
Support mocking modules 2022-12-18 15:18:20 -07:00