On 2/23/07, Naga Harish Kanegolla <[EMAIL PROTECTED]> wrote:
Is there a way to execute all the scripts at a time?
If you mean sequentially, you can do it like this.
If you have files called test1.rb and test1.rb, make file all_tests.rb in
folder where those files are located and put this in it
require "test1.rb"
require "test2.rb"
If names of your files change a lot, or if you add or delete your files
frequently, try this.
Open command prompt, navigate to folder with you tests, open irb and try
this code, then make script out of it.
irb> tests = Dir["test*.rb"] # test*.rb will exclude all_tests.rb
=> ["test1.rb", "test2.rb"]
irb> tests.each {|test| puts test} # this is just a test, to see what you
have in you array, you can skip it
test1.rb
test2.rb
irb> tests.each {|test| require test} # this will execute all files in
folder
For more information, see class Dir (
http://dev.rubycentral.com/ref/ref_c_dir.html) and watir unit tests (I
modified code from all_tests.rb )
--
Zeljko Filipin
zeljkofilipin.com
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general