I'm writing a very simple spec dispatcher, but I want to do it on the
level of examples. I'd like to be able to send individual examples to
my clients, have it run and receive the result back. Currently I can
send a file name and have the entire file run (thus distributing the
rspec tasks at the file-level), but I'm trying to distribute each
individual example out.
Thus if I can get a list of examples from a file along with their line
number, I can put them in a queue and have clients pull them out one
by one.
On Dec 28, 2009, at 8:59 AM, [email protected] wrote:
Date: Mon, 28 Dec 2009 10:59:07 -0600
From: David Chelimsky <[email protected]>
To: rspec-users <[email protected]>
Subject: Re: [rspec-users] Listing all specs in a given file
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
On Mon, Dec 28, 2009 at 10:48 AM, Sean Grove <[email protected]>
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
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users