With RSpec we can do before test do ... This gem enable to do so with test unit
require 'test_before' class .... < Test::Unit::TestCase before_test :test_me, :setup_for_test_me def test_me assert_equal "Cup of tea please", @var # OK end private def setup_for_test_me @var = "Cup of tea please" end end
gem install before_test
Doesn’t work with ActiveSupport 3 (In Development)