Michael Miller
38202ff605
Initial addition of pre- and post-conditions
2019-01-09 16:17:33 -07:00
Michael Miller
ab90f946d9
Allow "it" syntax in #given block
2019-01-09 15:08:01 -07:00
Michael Miller
17039d44f0
Initial implementation of #given macro
2019-01-09 14:58:10 -07:00
Michael Miller
950fcd250c
Add other syntaxes for #expect method
...
Can now check multiple values in the same #expect call.
Can use method short-hand syntax (&.foo) in #expect call.
2019-01-09 13:59:42 -07:00
Michael Miller
d3bf5eb4b1
Add short-hand #is and #is_not macros
...
These can be used for the one-liner "it" syntax.
2019-01-09 11:28:31 -07:00
Michael Miller
033f753dca
Initial implementation of one-liner "it" syntax
2019-01-02 13:24:30 -07:00
Michael Miller
0c3b3da2b3
Quickly implement #random_sample
by copy-pasting
...
This should be DRY'd up in the future.
2019-01-02 12:45:46 -07:00
Michael Miller
b7d3648256
Clarify that #let
can use expressions
2019-01-02 11:00:38 -07:00
Michael Miller
e6fd716586
Run around_each hooks in same context as example code
2019-01-01 17:58:54 -07:00
Michael Miller
050251b491
before_each and after_each hooks now run in example scope
...
The entire example hooks class hierarchy is no longer needed.
This is an easier implementation than originally planned.
However, this is probably slower than the other method because each hook
has to cast and check the example instance.
2019-01-01 17:51:55 -07:00
Michael Miller
aee3ead578
Revert "Pass current example to before_each and after_each hooks"
...
This reverts commit b5edb1e9f3
.
2019-01-01 17:48:07 -07:00
Michael Miller
b5edb1e9f3
Pass current example to before_each and after_each hooks
2019-01-01 16:56:23 -07:00
Michael Miller
abf7c8831c
Add getter for wrapped instance
2019-01-01 16:40:04 -07:00
Michael Miller
b53e1b60d8
Add BaseExampleHooks class
...
This is the first part in enabling before_each and after_each hooks to
access the example code's scope.
2019-01-01 16:33:07 -07:00
Michael Miller
c0be260f98
Ability to limit number of items sampled
2018-12-27 15:11:28 -07:00
Michael Miller
c1b27bb672
Rename "given" to "sample"
...
This falls in line with the `SampleValues` type.
It also frees up the keyword "given" to be used for something else.
2018-12-27 11:15:44 -07:00
Michael Miller
62549aae88
Functionality to retrieve all sample values
2018-12-13 14:30:11 -07:00
Michael Miller
c73af72c7f
Move formatter to config
2018-12-13 14:16:49 -07:00
Michael Miller
23368f6183
Structure for applying configuration
2018-12-13 13:50:59 -07:00
Michael Miller
38ec35dd29
Have the DSL builder produce a test suite
2018-12-12 15:27:40 -07:00
Michael Miller
6c5da5a703
Shuffle code around for runner
2018-12-12 15:22:56 -07:00
Michael Miller
c29748ede5
Restructuring how the test suite is driven
2018-12-12 11:48:08 -07:00
Michael Miller
6f5b03dc0f
Add top-level namespace docs
2018-12-10 16:08:25 -07:00
Michael Miller
4e0c821b8f
Add FinishedResult intermediary class
2018-12-10 14:07:14 -07:00
Michael Miller
9e004324c9
Remove shared elapsed time
...
Since PendingResult always returns zero, it's not necessary to store it.
2018-12-10 11:16:43 -07:00
Michael Miller
56e8f8978b
Detect errors in around_each
hooks
2018-12-07 23:28:30 -07:00
Michael Miller
4e57f6adca
Don't run after hooks if an error occurs
2018-12-07 23:01:02 -07:00
Michael Miller
4222603fea
Don't need reference to result anymore
2018-12-07 22:57:31 -07:00
Michael Miller
aeebbaa5b6
Raise error instead of failing test
...
If an error occurs in any hooks, raise it instead of failing the test.
2018-12-07 22:43:26 -07:00
Michael Miller
bd4d020d0f
Condense visible hook methods
2018-12-05 19:57:14 -07:00
Michael Miller
bd8df38ecd
Docs for RootExampleGroup
2018-11-23 23:54:54 -07:00
Michael Miller
fad3eba11f
Add docs for NestedExampleGroup
2018-11-20 14:04:14 -07:00
Michael Miller
c7963b70a3
Add docs for ExampleIterator
2018-11-20 11:51:47 -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
072055d947
Change test wrapper to a struct
2018-11-17 00:14:14 -07:00
Michael Miller
d52be1ec50
Add docs for ExampleHooks
2018-11-16 13:56:43 -07:00
Michael Miller
c045305bd2
Add docs for result types
2018-11-16 09:48:35 -07:00
Michael Miller
f0204a32ea
Fix specs to work with new Expectation type
2018-11-14 02:15:55 -07:00
Michael Miller
35b59854ec
Move #eval to partial
2018-11-13 21:44:56 -07:00
Michael Miller
a3ac50d661
Update harness to match recent changes
2018-11-13 21:44:25 -07:00
Michael Miller
a66262d197
Rename ExpectationResults to ExampleExpectations
...
Update to use new Expectation type.
2018-11-13 15:59:51 -07:00
Michael Miller
b625cb69cf
Adopt partials to use new Expectation type
2018-11-13 14:17:37 -07:00
Michael Miller
718f24aef3
Adopt ValueMatcher to new Expectation type
2018-11-13 14:11:51 -07:00
Michael Miller
06ced9f799
Change Expectation to store the result
...
This removes Expectation::Result and uses Expectation and sub-types
instead.
Having two "Result" types is confusing.
2018-11-13 14:08:27 -07:00
Michael Miller
e38747eafd
Formatting
2018-11-13 10:08:56 -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
b5a18ad324
Implement example iterator
2018-11-13 10:06:43 -07:00
Michael Miller
0e1d87d8d4
Add docs for #it and #pending
2018-11-08 22:40:01 -07:00