Commit graph

645 commits

Author SHA1 Message Date
Michael Miller
ab146c88c2 Bit of code cleanup 2018-10-14 17:43:33 -06:00
Michael Miller
bff6d463df Root group builder should not inherit from nested 2018-10-14 17:40:37 -06:00
Michael Miller
30a45a24d3 Restructure to use a composite design pattern
Examples and example groups now have a common ancestor.
2018-10-14 17:10:12 -06:00
Michael Miller
2070d7816b Root example group specialization 2018-10-14 14:28:05 -06:00
Michael Miller
3facf3af9d Change "description" to "what" for consistency 2018-10-14 11:50:08 -06:00
Michael Miller
68412daec0 Remove unused code 2018-10-14 01:02:52 -06:00
Michael Miller
77f631205e Break apart runnable example and document it 2018-10-11 10:16:48 -06:00
Michael Miller
34dce28663 Initial documentation and rework on runnable example 2018-10-10 16:57:43 -06:00
Michael Miller
81dce3df9a Cleanup and document some example classes 2018-10-10 13:05:17 -06:00
Michael Miller
53831ab36a Fix hook flags being nullable 2018-10-10 13:03:47 -06:00
Michael Miller
3e78f48d39 Pending examples weren't marked as finished 2018-10-09 14:53:51 -06:00
Michael Miller
d8223297af Treat harness more like a facade 2018-10-09 14:41:22 -06:00
Michael Miller
f5317ecbd3 Rig up the harness 2018-10-09 14:25:52 -06:00
Michael Miller
bfb133f44d Create example harness 2018-10-09 14:25:39 -06:00
Michael Miller
7b8f47f327 Implement expectation results 2018-10-08 11:25:22 -06:00
Michael Miller
297701c463 Merge branch 'master' of gitlab.com:arctic-fox/spectator 2018-10-08 10:36:27 -06:00
Michael Miller
c27f72c83e Add enum for example status 2018-10-07 16:13:17 -06:00
Michael Miller
64a233a9e1 Rename ExpectationRegistry to ExpectationReporter
Some initial implementation for the class.
2018-10-07 13:46:51 -06:00
Michael Miller
e14babc014 ExpectationFailed exception takes a result 2018-10-07 13:45:36 -06:00
Michael Miller
73a0d51c1b Rename message methods and add #failure? 2018-10-07 13:05:32 -06:00
Michael Miller
7277b3caaf Display actual value if label is empty 2018-10-07 12:49:10 -06:00
Michael Miller
38da6615bf Documentation for expectations and matchers 2018-10-07 12:42:09 -06:00
Michael Miller
a01ef9a4b7 Up-cast to get around type error 2018-10-07 02:07:25 -06:00
Michael Miller
d98bc05b88 Switch to structs to reduce memory allocations 2018-10-06 10:09:39 -06:00
Michael Miller
f11031f113 Upcast to fix type error 2018-10-06 09:58:58 -06:00
Michael Miller
79886e9efb More structure around exceptions and matching 2018-10-05 16:30:19 -06:00
Michael Miller
4c2f6157af Define some Expectation methods 2018-10-01 20:34:26 -06:00
Michael Miller
3035273e9a Rework how expectations and matchers work together 2018-09-28 11:47:42 -06:00
Michael Miller
4948fe0c6f Short-hand syntax for blocks with yield 2018-09-27 18:49:01 -06:00
Michael Miller
d670d96045 Remove extra assignment operations 2018-09-27 18:47:54 -06:00
Michael Miller
7484b92db9 Formatting 2018-09-27 17:50:50 -06:00
Michael Miller
b9abdb86ff Use actual value if label is empty
This will show a value instead of nothing if the should-syntax is used.
2018-09-27 16:28:47 -06:00
Michael Miller
77b4c71c2a Reduce nesting by collapsing modules with :: 2018-09-27 16:20:55 -06:00
Michael Miller
0d282d3d50 Wording - should-syntax instead of #should 2018-09-27 16:15:31 -06:00
Michael Miller
e9b8992130 Implemented should-syntax 2018-09-27 16:11:45 -06:00
Michael Miller
83a2a8e238 Manually include all sub-modules and top-level types
This is needed so that `spectator/should` is not included by default.
2018-09-27 15:49:34 -06:00
Michael Miller
1c9decaa41 Add documentation for top-level module 2018-09-27 15:41:18 -06:00
Michael Miller
00b7e15915 README improvements 2018-09-27 15:02:50 -06:00
Michael Miller
61c5505fb5 Update main description 2018-09-27 14:57:58 -06:00
Michael Miller
1a61235cdc Simplify #examples and #groups methods 2018-09-27 13:51:19 -06:00
Michael Miller
f63f8b15a0 Use label (expression string) instead of value 2018-09-24 22:58:35 -06:00
Michael Miller
371fe680c2 Pass matcher messages to failure results 2018-09-24 22:57:37 -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
ef7e0462cb GivenExampleGroupBuilder produces group of groups
Now a group is created for each element in the collection.
A group to contain the sub-groups is returned.
2018-09-24 00:25:15 -06:00
Michael Miller
1c7c6e5e90 Initial code for example names 2018-09-23 20:24:28 -06:00
Michael Miller
5e4f0f3bbc Initial formatting output for failures 2018-09-23 18:00:01 -06:00
Michael Miller
dcbca302dc Fix values being wrapped twice
This simplifies some code.
2018-09-23 17:13:30 -06:00
Michael Miller
cf0c438a5d Abstract away locals to SampleValues 2018-09-23 17:04:06 -06:00
Michael Miller
cddfe5591d Move ValueWrapper and TypedValueWrapper to Internals
Trying to hide from top-level some inner-workings.
2018-09-23 16:23:26 -06:00