The problem is that hooks are designed for a complete test lifecycle, and you 
want to surpress that lifecycle (the reporting of failures). There is a way 
around this but it’s more complicated.

If you want to use all of RSpecs config / lifecycle per run of a property you 
are going to have run each as a seperate example. To then achieve the 
suppression of spurious failures / the correct output you want you’re going to 
have build a custom formatter that knows about what your doing and can ignore 
those failures and take account of them in the final output. To be compatible 
with normal tests it will have to also be able to act as a normal formatter and 
differentiate the behaviour. You’ll also have to correct the spurious run 
results.

Jon Rowe
---------------------------
[email protected]
jonrowe.co.uk

On 24 June 2019 at 15:01, Wiebe-Marten Wijnja wrote:
> Thank you for your response! :D
>
>
> In the meantime I also found an old (2015) discussion on the Rspec google 
> groups about virtually the same topic:
> groups.google.com/forum/#!msg/rspec/XgY5wHI-S_c/whRRWbwDBwAJ 
> (https://groups.google.com/forum/#!msg/rspec/XgY5wHI-S_c/whRRWbwDBwAJ)
>
> The main issue that was mentioned there is that running all examples of a 
> property test inside `it` (using the technique of e.g. your example 
> pseudo-code)
> means that before/after(:each) hooks are only executed once for the entire 
> run, rather than once per generated input value-set.
>
> I will probably end up using the approach proposed by you for now for 
> simplicity's sake,
> but if there exists a way that allows users to leverage the existing test 
> lifecycle hooks that RSpec provides, that would of course be much nicer :-).
>
> Sincerely,
>
> ~W-M/Qqwy On Sunday, June 23, 2019 at 2:58:08 PM UTC+2, Jon Rowe wrote:

-- 
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rspec/dejalu-217-32b072a7-9825-4a8e-8570-bcae941024bb%40jonrowe.co.uk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to