class Minitest::Capybara::Spec include Minitest::Hooks around do |&block| device = metadata[:device] case device when :symbol Capybara.current_driver = Capybara.current_driver = device super(&block) when Array device.each do |device| Capybara.current_driver = Capybara.current_driver = device super(&block) end else Capybara.current_driver = Capybara.default_driver super(&block) end end end