jnicklas/capybara — pull request #584 by joliss (2011-12-31 00:58:44+00:00)
Title: Expand Test::Unit README section

Call reset_sessions! and use_default_driver in sample code, and explain
driver switching.

Be opinionated and recommend using DatabaseCleaner with the truncation
strategy. (Selective switching to transaction cleaning for Rack::Test is
hard to do without metadata, and the shared connection thing feels a bit
hackish -- you never know when it might break in the future.)

The instructions require Rails. Generic instructions are difficult to
write (we can't even use "teardown" with a block callback, and we don't
know the database situation), but are easy to figure out based on the
comments in the code, so I'm leaving them out, at least for now.

-------------------------------

The code is what I am using in my own app.

You can read the new section here: https://github.com/joliss/capybara/tree/test-unit-docs , section "Using Capybara with Test::Unit"

This might be worth extracting into library code, but I think it's a big improvement to even have it in the README for now, and it's a good starting point.