I think your best bet is probably to loop through the active windows and 
close each, something like this:

browser.windows.each {|w| w.close rescue nil}
browser.close rescue nil #The previous line should do this, but it's 
best to be sure

If you run that at the end it should close all webdriver windows.

-- 
Posted via http://www.ruby-forum.com/.