A rake question...running rspec tests in different directories

J

Jim Knowlton

So, I have something I need to do with Rake that I don't know how to
do, but seems like it would be possible...

- I have RSpec tests in multiple directories (for different
components). Each component has its own lib directory. The tests
refer to their respective lib directory as a relative path ('./lib').
Everything works fine if I have a rake file that runs the test from
the directory where the test file is. But if I try to set up a task
to run all the tests, the tests get confused, because they can't find
the helper scripts and files in their respective lib directories. So,
here is an example of how the directory structure is set up:

Component1
« Test_spec.rb
«lib directory
« component1_helper.rb

Component2
« Test_spec.rb
«lib directory
« component2_helper.rb

I want to run a single task that runs all the tests for component 1
and component 2, and reports the results as a single test run.

So, it seems that for each component I need to change to the
components directory, then run the tests from that directory context.
Then, report the results as a single test run. Can this be done with
Rake? I'm sorry if this is an easy question that's been answered
somewhere else...couldn't find anywhere how to do this.

Thanks,

Jim
 
Y

Yossef Mendelssohn

Component1
=AB Test_spec.rb
=ABlib directory
=9A =AB component1_helper.rb

Component2
=AB Test_spec.rb
=ABlib directory
=9A =AB component2_helper.rb

Nice use of box-drawing characters.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top