Commit graph

28 commits

Author SHA1 Message Date
Michael Miller
b5edb1e9f3 Pass current example to before_each and after_each hooks 2019-01-01 16:56:23 -07:00
Michael Miller
bd4d020d0f Condense visible hook methods 2018-12-05 19:57:14 -07:00
Michael Miller
f3feabb6e0 Reduce nesting of conditionals 2018-11-19 23:46:14 -07:00
Michael Miller
ee274dbebd Add docs for ExampleGroup 2018-11-19 21:52:10 -07:00
Michael Miller
e79d8872ac Cleanup indexer code 2018-11-19 19:41:51 -07:00
Michael Miller
6c882f9cae Remove ExampleGroup#all_examples
Implement the same functionality with ExampleIterator.
2018-11-13 10:08:37 -07:00
Michael Miller
61fe8e06d9 Change accessibility of children getter to public 2018-11-02 13:35:32 -06:00
Michael Miller
cd86687dfb Handle negative indices 2018-10-14 19:33:38 -06:00
Michael Miller
155e9ec81a Store example count instead of recalculating 2018-10-14 19:08:07 -06:00
Michael Miller
bcb68a5856 Implement example lookup by index
This will be used later for executing tests in random order.
2018-10-14 19:06:02 -06:00
Michael Miller
eade6873e4 Implement ExampleComponent#example_count 2018-10-14 18:37:54 -06:00
Michael Miller
467afd053c Implement iterator version of ExampleGroup#each 2018-10-14 18:29:01 -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
68412daec0 Remove unused code 2018-10-14 01:02:52 -06:00
Michael Miller
53831ab36a Fix hook flags being nullable 2018-10-10 13:03:47 -06:00
Michael Miller
4948fe0c6f Short-hand syntax for blocks with yield 2018-09-27 18:49:01 -06:00
Michael Miller
1a61235cdc Simplify #examples and #groups methods 2018-09-27 13:51:19 -06:00
Michael Miller
1c7c6e5e90 Initial code for example names 2018-09-23 20:24:28 -06:00
Michael Miller
855a5f2239 Move hook storage to their own class 2018-09-23 15:26:19 -06:00
Michael Miller
94e2f54713 Implement building groups and examples 2018-09-23 14:34:42 -06:00
Michael Miller
66ca06337d Fix locals not being passed to child groups 2018-09-21 14:26:09 -06:00
Michael Miller
a9d4acda36 Pass locals to example and test wrapper initializer
The #initialize method is defined in each context/given/module
that needs to add a local.
This is an elegant (although possibly confusing) solution.
2018-09-21 14:03:09 -06:00
Michael Miller
007572f0b8 Get rid of #add_examples
Added #example_count method to help with array sizing.
2018-09-19 23:13:43 -06:00
Michael Miller
aaf973b8cf Concat #all_examples instead of recursive #add_examples 2018-09-19 22:28:20 -06:00
Michael Miller
4d601281f6 Delay example creation by using factories
The #given block functionality specifically needs this to create 
multiple examples.
2018-09-19 21:58:32 -06:00
Michael Miller
06630e87d3 Rework how children are handled
Uses a loose version of the composite pattern.
This is to keep examples in the order they were declared.
2018-09-19 19:31:50 -06:00
Michael Miller
7968c5a394 Rename Context to ExampleGroup 2018-09-15 10:45:47 -06:00
Michael Miller
0613344230 Scratch work on structure 2018-08-19 01:15:32 -06:00