Thank you for your response. This seems like quite a big undertaking. Also, would having a custom formatter mean that it would be impossible for people to use their *own* custom formatter?
I think for now I'll choose the easier (but slightly less satisfying) approach of having the user specify lifecycle methods in the property itself explicitly. (And maybe have a custom way to run the same before/after actions for a whole group of property tests.) On Monday, June 24, 2019 at 3:05:53 PM UTC+2, Jon Rowe wrote: > > 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] <javascript:> > 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 > > 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/61402a33-8651-41d4-accf-ca866e22b13a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
