Commit graph

290 commits

Author SHA1 Message Date
Michael Miller
61a3e6b113 Remove unecessary type restrictions 2019-01-28 10:04:17 -07:00
Michael Miller
5231f0fd39 Copy/paste fail 2019-01-26 17:07:21 -07:00
Michael Miller
ed3f524f8d Add empty matcher 2019-01-26 17:02:42 -07:00
Michael Miller
5c68e7eb52 Create parameter-less initializer 2019-01-26 16:40:51 -07:00
Michael Miller
840da3a8b7 Derive type matcher from condition matcher 2019-01-26 16:26:26 -07:00
Michael Miller
69d0856256 Add nil matcher 2019-01-26 16:24:17 -07:00
Michael Miller
90de8c312d Create abstract conditional matcher 2019-01-26 16:23:16 -07:00
Michael Miller
90c5364946 Can't use "new" by itself like in Ruby 2019-01-25 13:25:40 -07:00
Michael Miller
3be2302df9 Add range modifier methods 2019-01-25 13:20:17 -07:00
Michael Miller
bc45a3bf41 Add basic range matcher 2019-01-25 13:00:19 -07:00
Michael Miller
c31557e8ff Move everything in BeComparison to TruthyMatcher
This is to match RSpec's ability to use "be" by itself.
For instance: `expect(foo).to be`
2019-01-23 22:10:03 -07:00
Michael Miller
d02e5d33b4 Add inequality matcher 2019-01-23 20:39:52 -07:00
Michael Miller
93801553b6 Implement equality method for BeComparison 2019-01-23 20:38:23 -07:00
Michael Miller
9ccba7570e Add greater-than-equal-to matcher 2019-01-23 20:37:33 -07:00
Michael Miller
ea6d7eac2a Add greater-than matcher 2019-01-23 20:34:53 -07:00
Michael Miller
52d0e6d55e Add less-than-equal-to matcher 2019-01-23 20:33:21 -07:00
Michael Miller
4ccc27321e Add less-than matcher 2019-01-23 20:31:28 -07:00
Michael Miller
f7d5c27e65 Should be ExpectedType instead of ActualType 2019-01-23 20:25:06 -07:00
Michael Miller
b93ef1fd2d Initial structure for "be OP value" syntax 2019-01-23 17:17:45 -07:00
Michael Miller
3d4d8f67be Document truthy flag 2019-01-23 16:07:26 -07:00
Michael Miller
a827b191a1 Use #actual instead of #value 2019-01-23 16:05:59 -07:00
Michael Miller
9befd5ee4f Add truthy matcher 2019-01-23 15:51:36 -07:00
Michael Miller
260e1884ab Implement match (regex) matcher 2019-01-19 14:40:14 -07:00
Michael Miller
419b1322bf Create parameterless initializer for TypeMatcher 2019-01-19 14:28:52 -07:00
Michael Miller
46875d7770 Implement be_a matcher 2019-01-19 14:08:50 -07:00
Michael Miller
45cdef021b Swap operands to get expected result 2019-01-19 13:42:45 -07:00
Michael Miller
a3ee53ed33 Implement be matcher 2019-01-19 13:29:10 -07:00
Michael Miller
35b59854ec Move #eval to partial 2018-11-13 21:44:56 -07:00
Michael Miller
718f24aef3 Adopt ValueMatcher to new Expectation type 2018-11-13 14:11:51 -07:00
Michael Miller
7f4690b042 Secondary initializer for missing label
Label is set to actual/expected stringified value if omitted.
2018-10-18 21:52:00 -06:00
Michael Miller
38da6615bf Documentation for expectations and matchers 2018-10-07 12:42:09 -06:00
Michael Miller
d98bc05b88 Switch to structs to reduce memory allocations 2018-10-06 10:09:39 -06:00
Michael Miller
79886e9efb More structure around exceptions and matching 2018-10-05 16:30:19 -06:00
Michael Miller
3035273e9a Rework how expectations and matchers work together 2018-09-28 11:47:42 -06:00
Michael Miller
77b4c71c2a Reduce nesting by collapsing modules with :: 2018-09-27 16:20:55 -06:00
Michael Miller
f63f8b15a0 Use label (expression string) instead of value 2018-09-24 22:58:35 -06:00
Michael Miller
8fb051d61e Add custom messages for matchers
This gives users natural, easier to understand text for expectations.
2018-09-24 22:56:48 -06:00
Michael Miller
562b544223 Capture expression string from expectations
This allows a string that the user had in source code instead of a resolved value.

This change requires storing a 'label' and changing expectation and matcher constructor methods to macros.
2018-09-24 22:51:26 -06:00
Michael Miller
6ca4d8d2a6 Move matchers DSL into their own module
Moves the #eq method out of the global namespace.
2018-09-15 11:58:43 -06:00
Michael Miller
7ec33943a4 Initial structure for matchers 2018-08-23 12:44:18 -06:00