while @driver.windows.count > 1
@driver.windows.last.close
end

Or

@driver.windows.last.use do
@driver.window.close
end

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