Commit graph

243 commits

Author SHA1 Message Date
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
Michael Miller
45230f3e67 Add docs for before, after, and around hooks 2018-11-08 13:31:50 -07:00
Michael Miller
cbfd14a88f Add docs for #subject, #let, and #let! 2018-11-08 11:29:51 -07:00
Michael Miller
e480901cdc Note about nested #given blocks
Remove unused and empty type method.
Crystal syntax doesn't allow methods where a generic type is expected.
2018-11-07 13:03:48 -07:00
Michael Miller
013f799c5e Remove #include_examples placeholder
Will be re-added when it is implemented.
2018-11-07 12:58:47 -07:00
Michael Miller
3abb48fe53 Allow implicit subject to take arbitrary arguments
This allows easy construction of the subject when it has an initializer
with parameters.
2018-11-07 12:55:38 -07:00
Michael Miller
4e690e7906 Merge described class and implicit subject macros
These macros are only called once.
2018-11-07 12:53:22 -07:00
Michael Miller
665c202848 Removes #it_behaves_like placeholder
Will re-add this when it is implemented.
2018-11-07 12:49:10 -07:00
Michael Miller
3571d9463a Remove #_spectator_given_collection macro
It is no longer needed since @type resolution isn't delayed.
2018-11-07 12:47:42 -07:00
Michael Miller
06743a181c Move collection class out of given module
The collection would incorrectly have access to the `given` block's
context,
instead of just the parent context, like it should.
2018-11-07 12:33:49 -07:00
Michael Miller
69905c01f3 Add docs for #given 2018-11-07 12:26:47 -07:00
Michael Miller
bf03cf03ce Add docs for #describe and #context 2018-11-06 14:05:41 -07:00
Michael Miller
0efaf9fa85 Formatting 2018-11-03 12:14:29 -06:00
Michael Miller
0a218b7e9f Some initial documentation for StructureDSL 2018-11-03 12:13:53 -06:00
Michael Miller
f6d6c859e6 Add docs for example and matcher DSL 2018-11-02 20:48:36 -06:00
Michael Miller
7c21f1e3eb Store user-friendly name of given variable 2018-11-02 18:11:46 -06:00
Michael Miller
61fe8e06d9 Change accessibility of children getter to public 2018-11-02 13:35:32 -06:00
Michael Miller
aea324a33b Add docs for group builders and example factory 2018-10-30 16:49:01 -06:00
Michael Miller
ee4623b471 Remove redundant #add_child method 2018-10-30 16:21:19 -06:00
Michael Miller
eb8ce6ff92 Add docs to DSL and builder 2018-10-28 18:27:54 -06:00
Michael Miller
746a5da107 Dummy example shouldn't be used 2018-10-23 11:15:22 -06:00
Michael Miller
4e9cf44c2c Add and update docs for internal module 2018-10-22 16:22:35 -06:00
Michael Miller
79392fbeff Add note about sample value names 2018-10-22 16:22:11 -06:00
Michael Miller
152ad5a5bf Change Entry to a private struct 2018-10-22 11:10:54 -06:00
Michael Miller
f8fa3e706d Add #get_value method to automatically cast 2018-10-22 11:08:55 -06:00
Michael Miller
532a314441 Add methods to force failure 2018-10-19 21:09:17 -06:00
Michael Miller
686304f31d Insert example failed exception 2018-10-19 20:58:14 -06:00
Michael Miller
9cf82928b7 Ensure harness is reset on error 2018-10-19 18:52:00 -06:00
Michael Miller
c48467f783 Slightly better wording and naming 2018-10-19 18:50:21 -06:00
Michael Miller
67e192edc6 Implement ExpectationResults specs and fix typo 2018-10-19 16:27:59 -06:00
Michael Miller
703a791f78 Formatting changes 2018-10-19 14:02:27 -06:00
Michael Miller
0892a073fe Change Result to a class
This is to get around a segfault.
I'm unable to reproduce this in a simpler example at this time.
However, this can be worked around by changing from a struct to a class.

Relevant backtrace:

Invalid memory access (signal 11) at address 0x4
[0x4829f6] *CallStack::print_backtrace:Int32 +118
[0x46de7d] __crystal_sigfault_handler +61
[0x7fe6ec64b390] ???
[0x486df5] *String#==<String>:Bool +37
[0x509ac4] *Spectator::Expectations::ValueExpectationPartial(Int32) +52
[0x50a52e] *Spectator::Expectations::ValueExpectation(Int32, Int32) +94
[0x50acb2] *Spectator::Expectations::Expectation::Result +210
[0x4fcd9b] *Spectator::Expectations::ExpectationResults +635
[0x50c9eb]*Spec::ContainExpectation(Spectator::Expectations::Expectation::Result)+43
[0x4fcaea] *Spectator::Expectations::ExpectationResults +138
...
2018-10-19 13:04:51 -06:00
Michael Miller
7f4690b042 Secondary initializer for missing label
Label is set to actual/expected stringified value if omitted.
2018-10-18 21:52:00 -06:00
Michael Miller
9a77f8b7fd Add specs for value expectation
Fix bug in expectation result actual message.
2018-10-18 17:54:43 -06:00