How do I find out the seed # of a random RSpec spec?

Probably a dumb question, but the output window in RubyMine for RSpec runs doesn't show the seed # for me when I have spec_helper.rb configured as follows:

  config.order = "random"

(1) Any idea where I find the seed #?

(2) Also, once I find it, what's the easiest way to re-run the tests using that seed #?  i.e., where do I put the "--seed 1234" (and then remove it later, easily)?

Thanks.

5 comments
Comment actions Permalink

*bump*

Is this just a missing feature (and I should report it in the bug tracker)?  If not, *someone* at JB must really know how to find this in RM...!

0
Comment actions Permalink

Hi,

I'm not an expert in RSpec and I do not have an answer for you.  But I wonder how you would figure out the seed in command line?
RM is just a tool which helps you to run other tools if you know how to achieve the result from command line then it should be possible to
modify run configuration to do the same.  If you do not know then the question is not about RM, but about the tool you use (RSpec in this case).
We are good in answering the questionswhich are similar to: "In command line I can do this. How I can do the same in RM", and, unfortunately,
we do not know all answers to Ruby-related  questions (we are not a full-day ruby developers:()
So to increases probability to get an answer I'd suggest to rephrase your question in the way described above ;)

Regards, Oleg.

0
Comment actions Permalink

Running rspec
I can see in the console "Randomized with seed 206".

How to set seed in RM, so tests are executed in the same order?
Thanks.

0
Comment actions Permalink

Most likely you need to provide "--seed 206" to rspec.  In RM you should edit the run configuration you use (Run|Edit configurations...)
and add this to the appropriate field (depends on type of run configuration you use)

Regards, Oleg.

0
Comment actions Permalink

Thanks.
It looks like working, tests are now performed in the same order.
I've set "--seed 206" to Runner options.



Attachment(s):
RM Runner options.png
0

Please sign in to leave a comment.