[rspec-users] Listing all specs in a given file

David Chelimsky dchelimsky at gmail.com
Mon Dec 28 11:59:07 EST 2009


On Mon, Dec 28, 2009 at 10:48 AM, Sean Grove <sean at saucelabs.com> wrote:

> I'm trying to write a simple spec dispatcher, the client-side of which
> essentially does the following:
>
> options = Spec::Runner::OptionParser.parse( "#{file}", $stderr, std_out )
> options.line_number = line
> Spec::Runner::CommandLine.run(options)
>
> Given a spec file and a line number, it'll run the spec. Simple enough.
>
> My problem is on the server side trying to pull out individual specs to be
> run out of a file/series of files. The above code works well if I
> pre-populate and array as follows:
>
> queue = [["spec/one_spec.rb", 9],
>         ["spec/one_spec.rb", 28],
>         ["spec/one_spec.rb", 35]]
>
> But I'm having a hard time figuring out how to pull out a list of examples
> given a spec filename. Is this parsed at some point before running, and can
> I get to that list easily enough?
>

I'm not clear on what your goal is here. Can you give a little more context?
Why do you need a list of examples from a filename?


>
> Thanks for all the help!
>
> Sean
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20091228/f7f774d2/attachment-0001.html>


More information about the rspec-users mailing list