Commit graph

493 commits

Author SHA1 Message Date
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
Michael Miller
7a6045a1f3 Change #it_behaves_like to a macro 2018-09-23 16:10:07 -06:00
Michael Miller
b3b8efdd59 Mark helper macros private 2018-09-23 16:07:58 -06:00
Michael Miller
70e37eeccf DRY up DSL 2018-09-23 16:07:03 -06:00
Michael Miller
0f323666a0 Fix methods for adding hooks 2018-09-23 15:41:58 -06:00
Michael Miller
855a5f2239 Move hook storage to their own class 2018-09-23 15:26:19 -06:00
Michael Miller
57c9f2c58e Copy/paste to reimplement pending examples 2018-09-23 14:53:32 -06:00
Michael Miller
56ae92a25d Add symbol for getting local from #given 2018-09-23 14:45:36 -06:00
Michael Miller
3c31783fd7 Pass arguments directly onto initializer with splat 2018-09-23 14:45:14 -06:00
Michael Miller
03a8efd7f8 Create test instance when example is created
This exposes errors in the framework
instead of delaying them until the test runs.
2018-09-23 14:39:05 -06:00
Michael Miller
94e2f54713 Implement building groups and examples 2018-09-23 14:34:42 -06:00
Michael Miller
037fe604ea Example group builder classes should build groups
It's implied in their name.
2018-09-23 13:40:16 -06:00
Michael Miller
d551cf6e1b Add missing GivenExampleGroupBuilder class 2018-09-23 12:27:21 -06:00
Michael Miller
6bf07e3967 Collection for #given is now an array of ValueWrapper 2018-09-23 12:27:08 -06:00
Michael Miller
faf3bef05c Fix typo 2018-09-23 12:21:10 -06:00
Michael Miller
fc1c0351cd Must use class variables 2018-09-23 12:19:29 -06:00
Michael Miller
ab7087649d Example wrappers need a top-level initializer
The default initializer made by the compiler takes no arguments.
Use this one to not create a default initializer.
2018-09-23 12:19:07 -06:00
Michael Miller
ecba0d00ec Pass group to example initializer 2018-09-23 12:16:38 -06:00
Michael Miller
09184f4a2a Group builder needs "what" as first arg 2018-09-23 12:15:53 -06:00
Michael Miller
0999cb2dbc Use fully-qualified names 2018-09-23 12:05:19 -06:00
Michael Miller
9109fc30fd Can pass types around (somewhat) at runtime
No need for extra factory classes.
2018-09-23 12:03:52 -06:00
Michael Miller
9ba3fc898b More refatoring 2018-09-22 19:41:56 -06:00
Michael Miller
a1b5533504 Some initial work to cleanup the DSL builder 2018-09-22 15:15:29 -06:00
Michael Miller
a82076e2b7 Remove type from group macros
This value is never directly seen,
so it isn't necessary to support it.
2018-09-22 11:38:00 -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
39be62c511 Temp disable until I figure out how to reference wrapped example 2018-09-20 18:41:21 -06:00
Michael Miller
8b8981494d Trying to get exaples to map to their given values 2018-09-19 23:00:17 -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
bb7f036a82 Make Example#group abstract
Instead of passing parent group as an argument, define the group method 
in the exapmle class created by the #it macro.
2018-09-19 21:50:51 -06:00
Michael Miller
0f7640411f Use symbols instead of strings for hash lookups 2018-09-19 21:06:10 -06:00
Michael Miller
a28f512ae4 Some code for repeating examples in given blocks 2018-09-19 20:49:01 -06:00
Michael Miller
830aa7b43a Structural code for enumerating given value sets 2018-09-19 20:00:26 -06:00
Michael Miller
2be9d65997 Add examples to group children 2018-09-19 19:32:59 -06:00
Michael Miller
d679c356fd Move conditional into context macro 2018-09-19 19:29:33 -06:00
Michael Miller
fe81341e1a Rename MAPPING to GROUPS - better name 2018-09-19 18:58:44 -06:00
Michael Miller
41c0d9abc7 Initial changes for DSL refactor
No examples are picked up right now.
2018-09-19 18:53:09 -06:00
Michael Miller
fa73bf3a60 Hide method to infer type of first in collection in given macro
This was a bit of a hack.
2018-09-15 23:38:07 -06:00
Michael Miller
80fbe89b4c Track children in DSL 2018-09-15 16:58:59 -06:00
Michael Miller
a06ea6088c Shorten GroupDefinitions to Definitions 2018-09-15 16:53:28 -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
1ea06998e7 Move #expect from global namespace to example DSL 2018-09-15 11:30:45 -06:00
Michael Miller
967797428c Move DSL to its own directory 2018-09-15 11:21:23 -06:00