Commit graph

30 commits

Author SHA1 Message Date
Michael Miller
c6b4e22666 Add have_key matcher 2019-02-05 12:47:50 -07:00
Michael Miller
6bfd15b7f9 Parameterless initializer that generates the label 2019-02-05 10:36:37 -07:00
Michael Miller
0e0b8f4ae2 Base PredicateMatcher off of Matcher
No need to store an expected value.
Matcher's initializer must be public.
2019-02-05 10:14:33 -07:00
Michael Miller
89208b8ed1 Implement predicate matcher
Took a trick I learned from `have_attributes` and applied it here.
2019-02-04 22:52:09 -07:00
Michael Miller
1c9cb41fa2 Add have_attributes matcher
This one is kind of magical.
2019-02-01 22:24:06 -07:00
Michael Miller
0c4ffdf587 Allow have matcher to take multiple values 2019-02-01 20:27:51 -07:00
Michael Miller
85b4e6894b Allow contain matcher to take multiple values 2019-02-01 19:43:42 -07:00
Michael Miller
5389a39231 Add DSL for be_close matcher 2019-02-01 19:10:28 -07:00
Michael Miller
4ea439622d Implement have matcher
This is very similar to the `contain` matcher.
I would have used `include` for the matcher name, but it is a keyword
that can't be used in this syntax.
2019-02-01 16:25:45 -07:00
Michael Miller
f4ac7a3405 Add contain matcher 2019-01-31 23:06:00 -07:00
Michael Miller
d0711f940d Add end_with matcher 2019-01-31 22:05:27 -07:00
Michael Miller
0a310cb243 Add start_with matcher 2019-01-31 16:43:43 -07:00
Michael Miller
30582f9a89 Add empty matcher to DSL 2019-01-26 17:04:46 -07:00
Michael Miller
028065ad26 Add #be_nil to DSL 2019-01-26 16:42:58 -07:00
Michael Miller
abc321130a Add DSL for range matching 2019-01-25 13:20:38 -07:00
Michael Miller
154832e5c4 Add be_an variation of be_a 2019-01-25 11:21:41 -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
0c284b6713 Add other comparison matchers to DSL 2019-01-23 21:45:16 -07:00
Michael Miller
b93ef1fd2d Initial structure for "be OP value" syntax 2019-01-23 17:17:45 -07:00
Michael Miller
8c6552a995 Add DSL for be_truthy and be_falsey 2019-01-23 15:51:52 -07:00
Michael Miller
429c2d7302 Add #be_true and #be_false to DSL 2019-01-23 15:35:32 -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
4a7167597b Remove documentation for unsupported cases
Turns out the `case` keyword does some extra magic that isn't trivially 
implemented.
2019-01-19 13:44:38 -07:00
Michael Miller
a3ee53ed33 Implement be matcher 2019-01-19 13:29:10 -07:00
Michael Miller
f6d6c859e6 Add docs for example and matcher DSL 2018-11-02 20:48:36 -06:00
Michael Miller
77b4c71c2a Reduce nesting by collapsing modules with :: 2018-09-27 16:20:55 -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