I have to unit test a model which has associations to some other
models which are expensive to create. They are currently being
created inside my `setup`, but since this gets executed before every
single `should` statement, my tests take an excruciating amount of
time to run.
I'm looking for a way to initialize these objects exactly once, and
have them persist throughout the entire test case. RSpec's `before
(:all)` method[1] is exactly what I'm looking for. I'm not concerned
about the dependencies this method creates because my tests will not
modify the associated objects.
I've created a gist that hopefully illustrates my scenario.[2]
Thanks,
Kyle.
[1]
http://rspec.info/documentation/
[2]
http://gist.github.com/225513