@tgxworld :

Yes something like that. You should put the connection variable at the end and assign it ActiveRecord::Base.connection as default. This should be good for most cases. Also I don't think we need to yield the connection. It's just an argument passed in and the caller will have access to it already. A block with no arguments should be good.
There are no hard guidelines. I try to only put things in setup that absolutely need to happen for each case. Otherwise the setup method quickly becomes bloated. It also slows down the tests for no reason. There are two things you can do, when many test-cases share the same setup but not all of them:
Create a new TestCase class with the setup and move the tests over
Introduce a helper to easily create the setup within each test.
We do not have a hard limit on Ruby files. I try to avoid really long lines and make it visually appealing. We do wrap *.md files to 80 chars.