Commit graph

712 commits

Author SHA1 Message Date
Michael Miller
95b4a349da Update InequalityMatcher to use MatchData 2019-03-05 19:00:49 -07:00
Michael Miller
d35a739e60 Update LessThanMatcher to use MatchData 2019-03-05 16:53:15 -07:00
Michael Miller
f846408848 Update LessThanEqualMatcher to use MatchData 2019-03-05 16:37:51 -07:00
Michael Miller
36d3bd0a70 Update GreaterThanMatcher to use MatchData 2019-03-05 16:28:29 -07:00
Michael Miller
83d398465f Update GreaterThanEqualMatcher to use MatchData
Add PrefixedValue type to help convey values better (without string
concat).
2019-03-05 15:39:30 -07:00
Michael Miller
0288e1d6f8 Add tests for match data values 2019-03-05 14:00:14 -07:00
Michael Miller
27409f4a92 Display last item and full list when #last is used
Only perform one check with #responds_to?.
2019-03-05 13:52:59 -07:00
Michael Miller
52f8c52a58 Fix EndWithMatcher compile errors 2019-03-04 21:43:26 -07:00
Michael Miller
7b0f607a6a Update EndWithMatcher to use MatchData 2019-03-04 20:16:21 -07:00
Michael Miller
1090a7f2f3 Fix botched copy/paste 2019-03-04 18:30:18 -07:00
Michael Miller
e7441df159 Update AttributesMatcher to use MatchData
This is a glorious mess.
2019-03-04 16:06:20 -07:00
Michael Miller
df663d30d9 Update EmptyMatcher to use MatchData 2019-03-03 20:21:39 -07:00
Michael Miller
be3218bcd8 Update ContainMatcher to use MatchData 2019-03-03 20:03:20 -07:00
Michael Miller
1db5341f4b Add tests for match data values 2019-03-03 19:31:39 -07:00
Michael Miller
cdef7f9fa3 Use macro yield and remove &block when not needed 2019-03-03 19:24:56 -07:00
Michael Miller
51765c0c8b Fix strange compiler error
Compiler said there was an error, but not what it was.
The compiler wasn't clear where the issue was either.
2019-03-03 19:06:37 -07:00
Michael Miller
e38bcd544a Update CaseMatcher to use MatchData 2019-03-03 19:05:20 -07:00
Michael Miller
50a782b803 Minor adjustments to equality matcher 2019-03-03 12:26:31 -07:00
Michael Miller
ec06daaf35 Test values returned by match data 2019-03-03 12:13:35 -07:00
Michael Miller
bb3f2d5338 Update README for formatters 2019-03-03 12:00:56 -07:00
Michael Miller
ffed61b9e3 Implement condensed document output 2019-03-03 11:56:43 -07:00
Michael Miller
52a6a645b9 Display group names 2019-03-03 11:05:28 -07:00
Michael Miller
f338e9b99d Add -v argument to use document formatter 2019-03-03 10:52:15 -07:00
Michael Miller
a3c4d06e45 WIP code for document formatter (-v) 2019-03-03 10:51:52 -07:00
Michael Miller
ca92fbb29f Extend self in Spectator module 2019-03-03 10:49:28 -07:00
Michael Miller
5481c3d431 Formatting 2019-03-03 10:32:00 -07:00
Michael Miller
8310ea2aa5 Label exception with type 2019-03-03 10:30:58 -07:00
Michael Miller
6307024af3 Colorize matcher values green and red 2019-03-03 10:26:03 -07:00
Michael Miller
df71e56b3e Replace FailureMessage with LabeledText 2019-03-03 10:19:17 -07:00
Michael Miller
2c5da0c345 Move message line inside content
This allows for multiple message lines for multiple expectations.
2019-03-03 10:11:46 -07:00
Michael Miller
238dc38a36 Use Indent tracker type 2019-03-03 09:54:39 -07:00
Michael Miller
8cdc5f0b3f Fix indent and add empty line method 2019-03-03 09:54:09 -07:00
Michael Miller
f73a51ae0c WIP display all expectations
Display the error stacktrace after expectations if the result is an 
ErroredResult.
2019-03-03 09:48:44 -07:00
Michael Miller
66c1dc3bce Create indentation guide type 2019-03-03 09:46:12 -07:00
Michael Miller
e722cc4f1f Initial code for displaying errors 2019-02-28 22:16:33 -07:00
Michael Miller
f37105af5e Add padding to pairs to right-align key 2019-02-28 20:14:03 -07:00
Michael Miller
cc3392022e Move value enumeration to another type 2019-02-28 19:49:23 -07:00
Michael Miller
0fce18a610 Use inspect instead of to_s for values 2019-02-28 19:29:24 -07:00
Michael Miller
daf2f43f25 Rename module from Formatters to Formatting 2019-02-28 19:14:03 -07:00
Michael Miller
80150f945b Change back to passing text as argument 2019-02-28 16:48:26 -07:00
Michael Miller
1610d6ebe3 Create a type to output a key-value pair 2019-02-28 16:46:50 -07:00
Michael Miller
4e3290ebfe Initial code to get match data values to output
Expose the match data values through the Expectation class.
2019-02-28 16:35:50 -07:00
Michael Miller
0a48b5f447 Use block with line method 2019-02-28 16:30:56 -07:00
Michael Miller
d5bef6f1da Fix flipped expected and actual labels
NilMatcher output was correct, but variables were named incorrectly.
2019-02-28 16:08:22 -07:00
Michael Miller
1219b19d89 Support shorthand &.foo(ARGS) syntax 2019-02-28 15:40:04 -07:00
Michael Miller
619927b3e6 Forgot to swap label and expected in DSL 2019-02-28 15:22:14 -07:00
Michael Miller
6942e70024 Remove unnecessary type specification 2019-02-28 15:18:56 -07:00
Michael Miller
65dd6243dd Rename to match class name 2019-02-28 15:17:50 -07:00
Michael Miller
5ba03a90ff Swap label and expected value parameters
This matches the partial initializer parameters.
Also cleaned up some code in the Expectation spec.
2019-02-28 15:17:12 -07:00
Michael Miller
f3e50c6432 TruthyMatcher doesn't need to store a label
Extend from Matcher instead of ValueMatcher to bypass storing the label.
The "expected" value is still used, but is renamed to "truthy" and used
for the label.
2019-02-28 14:52:15 -07:00