Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Running a rake test task within a specific directory

Reply
Thread Tools

Running a rake test task within a specific directory

 
 
Daniel Berger
Guest
Posts: n/a
 
      01-25-2007
Hi all,

I'm trying to figure out how to setup a task that temporarily changes
to a specific directory, runs the tests, and returns to the current
directory when finished. In case you're wondering why, I have some test
cases that create temporary files (in the setup method), use those temp
files in the tests themselves, and then delete them (in the teardown
method).

While I could jump through hoops to make sure the proper path of the
temp files are found within each test case, I'd rather not. I was
hoping to do something like this:

Rake::TestTask.new('test_file') do |test|
Dir.chdir('test/core/File') do
test.test_files = FileList['*/*.rb']
end
end

Unfortunately, that doesn't seem to work, and I'm not sure why. Any
ideas?

Thanks,

Dan

PS - On an unrelated note, I *hate* this new google groups interface. I
can't see my subscribed groups on the same page (it's an extra click
away now), and there's no more "preview" option in the compose window.
Oh, and the color scheme is depressing. BARF!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
rake published rdoc version and arity of Rake::Task#execute - wrongnumber of arguments (0 for 1) James Mead Ruby 0 01-15-2008 05:42 PM
Rake TestTask running its block anytime rake is invoked Adam Anderson Ruby 1 09-19-2007 08:40 AM
[Rake] call a task of a namespace from an other task. Stéphane Wirtel Ruby 3 06-15-2007 06:52 AM
Rake and rake aborted! Rake aborted! undefined method `gem' for main:Object peppermonkey Ruby 1 02-10-2007 04:43 AM
test test test test test test test Computer Support 2 07-02-2003 06:02 PM



Advertisments