I would still put the loop inside the it blocks, so you're just running a few actual specs, and then running your loop just to test the actual thing you're testing.
Otherwise you're just running the same spec again and again, each time doing Rspec's teardown and setup procedure, which will surely reset the state of your app & database to its original state, so it seems very counter-intuitive to me to do something like that. It's like you're just hitting your head against a wall and then wondering why your head hurts. At least that what it seems like to me, but I don't have the full context of what you're trying to achieve. Seem's like Allen Madsen's answer with a link https://github.com/piotrmurach/rspec-benchmark is a good option for benchmarking. (Which is actually distinct from load and stress testing) > On Feb 23, 2017, at 9:34 AM, Satya Rao <[email protected]> wrote: > > Thanks Jason for your reply. > Let me explain what I'm trying to do here. In my rspec script I have 5 > examples(i.e. 5 it blocks) under 1 describe block which I need to repeat all > these 5 examples sequentially 5 lach times to test the stability of my device > under test. this is my requirement. What is the best possible way to do this? > > Thanks, > Satya. ---- Jason Fleetwood-Boldt [email protected] http://www.jasonfleetwoodboldt.com/writing If you'd like to reply by encrypted email you can find my public key on jasonfleetwoodboldt.com <http://jasonfleetwoodboldt.com/> (more about setting GPG: https://gpgtools.org) -- 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/981B308C-AE45-44A0-B557-6C8793B60DF3%40datatravels.com. For more options, visit https://groups.google.com/d/optout.
