Forum: Ruby on Rails testing a gem outside the rails framework

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
John S. (Guest)
on 2009-04-10 14:35
I'm writing an acts_as_something gem for ActiveRecord. I want to test it
only on the ActiveRecord part of the framework. Therefore I'm not
loading the entire rails framework, only ActiveRecord. That's all fine
but I need to wrap each test in a transaction which gets rolled back in
the teardown for each test. ActiveSupport is supposed to do this if you
set the undocumented use_transactional_fixtures = true except that
doesn't appear to be working in 2.3.3 and in any case I don't want to
load ActiveSupport.

Really I want to use Test::Unit along with Shoulda. I can get the
transaction to start in Test::Unit::TestCase setup, but how can I get it
to rollback in teardown? There's no rollback method to complement

Comments please

John S.
This topic is locked and can not be replied to.