Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Rake TestTask running its block anytime rake is invoked
Adam Anderson
9/19/2007 7:18:00 AM
--
require 'rake/testtask'
Rake::TestTask.new do |t|
chdir './../'
puts pwd
end
desc "print working directory"
task :pwd do
puts "Working Directory #{pwd}"
end
--
$ rake -T
cd ./../
/Users/scudco/projects
rake chdir # change directory
rake test # Run tests
$ rake chdir
cd ./../
/Users/scudco/projects
Working Directory /Users/scudco/projects
So the question is why does the chdir in the TestTask get executed every
time no matter what? It is quite frustrating when code specific to a
block is being executed for every other task. Any ideas?
--
Posted via
http://www.ruby-...
.
1 Answer
Adam Anderson
9/19/2007 8:41:00 AM
0
--
require 'rake/testtask'
Rake::TestTask.new do |t|
chdir './../'
puts pwd
end
desc "print working directory"
task :pwd do
puts "Working Directory #{pwd}"
end
--
$ rake -T
cd ./../
/Users/scudco/projects
rake pwd # print working directory
rake test # Run tests
$ rake pwd
cd ./../
/Users/scudco/projects
Working Directory /Users/scudco/projects
Attachments:
http://www.ruby-...
attachment/31...
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Rake TestTask running its block anytime rake is invoked
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password