0

When I run my Hspec test suite, it mentions the random seed that it used for that run. I assume it’s using that seed for the properties, but I’d also like to use it to generate arbitrary examples in my non-property examples. How would I go about doing that?

To be more specific, I’m trying to figure out how to get access to the same source of randomness that Hspec is using. I’ve been over the API docs looking for something shaped like SpecM a (Gen x), and I don’t see anything that would allow me to do that.

Jason Whittle
  • 751
  • 4
  • 23
  • That's asking for a tutorial, which is off-topic. Do you have a concrete example/question? – Zeta Oct 27 '16 at 07:23
  • Sorry, I haven’t been able to figure out a more specific version of this question. I’m just trying to figure out how to get access to the same source of randomness that Hspec is using within the `SpecM` monad. – Jason Whittle Oct 27 '16 at 15:19
  • Zeta, I tried to make the question more specific. I think the issue is that I’m looking for a way to read the generator out of the environment of the `SpecM` and—because that’s not provided—I don’t know how to move forward. – Jason Whittle Oct 27 '16 at 15:43

0 Answers0