Michael Miller
848f80ddf8
Add block short-hand syntax support to change matcher
2019-08-11 13:16:40 -06:00
Michael Miller
2666f80653
Hackish fix for block short-hand syntax
...
Dunno when this broke or how it ever worked. 😐
2019-08-11 13:16:18 -06:00
Michael Miller
27436b4e09
Need to use fresh variables in this macro
2019-08-11 12:55:38 -06:00
Michael Miller
5dfcad3cb4
Flip operands of != in case expected has custom logic
2019-08-11 12:40:27 -06:00
Michael Miller
e1a119639f
Add change exact matcher
2019-08-11 12:39:33 -06:00
Michael Miller
3c539b3517
Fix require statements
2019-08-10 12:54:46 -06:00
Michael Miller
1d205b6ee9
Put test expression on its own line
2019-08-10 12:49:54 -06:00
Michael Miller
214b2e171e
Refactor existing change matchers to use new format
2019-08-10 12:42:57 -06:00
Michael Miller
db1118dac1
Fix spec after rebase
2019-08-10 12:26:00 -06:00
Michael Miller
e6599d5fe0
Remove specs for change matchers (for now)
2019-08-10 11:40:33 -06:00
Michael Miller
a56d6762c0
Formatting
2019-08-10 11:38:13 -06:00
Michael Miller
535dc6e923
Add change.to variant
2019-08-10 11:37:19 -06:00
Michael Miller
d2823398ff
Remove useless assignment (Ameba find)
2019-08-10 11:37:19 -06:00
Michael Miller
817128b286
Add tests for change.from
2019-08-10 11:37:19 -06:00
Michael Miller
59cf939536
Don't store initial value in matcher
2019-08-10 11:37:19 -06:00
Michael Miller
770100891c
Add change.from variant
2019-08-10 11:36:38 -06:00
Michael Miller
946604b737
Add tests for override cases
...
Fix negated? method.
2019-08-10 11:34:16 -06:00
Michael Miller
24066c46a0
Allow MatchData to control whether they can be negated
...
Values are still negated, but message and matching status are not.
2019-08-10 11:27:15 -06:00
Michael Miller
3e1ee7eb6d
Initial code for basic change matcher
2019-08-10 11:21:14 -06:00
Mike Miller
1521107934
Merge branch 'matcher-refactor' into 'release/0.8'
...
Matcher refactor
See merge request arctic-fox/spectator!13
2019-08-10 17:14:10 +00:00
Michael Miller
ede691dd6a
Reorder methods to be in a more standard layout
2019-08-10 11:10:48 -06:00
Michael Miller
898ddcb616
Type annotations for #match?
2019-08-10 10:55:22 -06:00
Michael Miller
c4b886cad2
Add match data docs
2019-08-10 10:53:00 -06:00
Michael Miller
d5fd21702a
Add matcher docs
2019-08-10 10:50:48 -06:00
Michael Miller
37c8dd0865
Stringify respond_to bools
2019-08-10 09:55:26 -06:00
Michael Miller
39f253952d
Add docs and some more type annotations
2019-08-09 17:26:53 -06:00
Michael Miller
db4eaca291
Just assert the return value isn't nil
2019-08-09 17:21:12 -06:00
Michael Miller
efd0ab089d
Define type annotations for match methods
...
Hopefully this speeds up some compilation.
2019-08-09 16:58:35 -06:00
Michael Miller
a54e406fec
Clean up expectation specs
...
Removed tests that are no longer valid or non-trivial to update.
2019-08-09 15:32:22 -06:00
Michael Miller
251e3b8774
Remove specs for matchers
...
Will replace with Spectator-based tests later.
2019-08-09 15:16:01 -06:00
Michael Miller
85b7412436
Fix some more matcher errors
2019-08-09 15:14:00 -06:00
Michael Miller
8fc3af075c
Workaround for NoReturn type for block
...
Not sure if this will work for everything.
It seems that NoReturn shows up as ReturnType (generic) when the
compiler detects the block will raise.
2019-08-09 15:06:22 -06:00
Michael Miller
c47b47ade9
Fix most problems (hopefully) with ExceptionMatcher
2019-08-09 14:18:59 -06:00
Michael Miller
2251168631
Get inspection string of attribute values
2019-08-09 14:01:10 -06:00
Michael Miller
751c15434b
Help infer the block's return type
2019-08-09 11:29:53 -06:00
Michael Miller
e763296c26
Remove inspection quotes from around output values
2019-08-09 11:23:10 -06:00
Michael Miller
0dfde61807
Fix method name matches? -> match?
2019-08-09 11:20:41 -06:00
Michael Miller
5a1dea8f72
Convert bools to strings for output
2019-08-09 11:20:29 -06:00
Michael Miller
3d86893f44
Resolve various duck-typing issues
2019-08-09 11:13:13 -06:00
Michael Miller
114bfa47c2
Genericize TestExpression and make value abstract
...
This seems to resolve issues with the compiler making unions of
unrelated test case types.
2019-08-09 11:12:15 -06:00
Michael Miller
569faa0a2b
Various other fixes
2019-08-09 00:42:39 -06:00
Michael Miller
8b718f0bd0
Handle union case for expected value
...
When using both forms of the HaveMatcher - expected can be a Char,
String, or Regex. Regex is invalid for String#includes?.
I believe this might be a generics issue that was fixed recently in
Crystal.
2019-08-09 00:32:45 -06:00
Michael Miller
353e5f6886
Update formatting to use Tuple
2019-08-08 21:57:02 -06:00
Michael Miller
9dc5a999d1
Fix method name (copy/paste fail)
2019-08-08 21:52:33 -06:00
Michael Miller
3b1a5a1121
Fix various expectation type code
2019-08-08 21:52:05 -06:00
Michael Miller
21e10c1ef2
Fix expected value snapshot
2019-08-08 21:39:30 -06:00
Michael Miller
955311bb95
Don't force Enumerable expected type
...
Should duck type anyway.
2019-08-08 21:38:49 -06:00
Michael Miller
eef7e9ce3c
Wrap expression and label in TestValue
2019-08-08 17:15:13 -06:00
Michael Miller
4665d5f68d
Fix inconsistent naming for test expressions
2019-08-08 17:08:38 -06:00
Michael Miller
2eb51b9c41
Fix type inference in TestValue
2019-08-08 17:05:44 -06:00