[rspec-users] [rspec] loading specs as an object model without running them

Marty Andrews marty at martyandrews.net
Wed Apr 29 02:23:15 EDT 2009

I'd like to load all of my examples into memory without actually
running them, so I can traverse the object tree and get descriptions
etc.  I'm finding it tricky to figure out how to do that though.
There seems to be an inherent assumption in the framework that that
examples will actually run.

So basically, I want to do something like this:

examples = load_examples_without_running
examples.each {|example| puts example.description}

def load_examples_without_running
 # what goes here?

Does anyone have an idea about how I might do that?

-- Marty Andrews

More information about the rspec-users mailing list