Howto Make A Fixture Available in All Tests
Posted by Jeremy Voorhis Mon, 08 May 2006 03:43:00 GMT
In test/test_helper.rb:
class Test::Unit::TestCase
def self.fixtures_with_users *names
self.fixtures_without_users [:users, *names]
end
class << self; alias_method_chain :fixtures, :users end
end
Does anybody know another way to do this?

You’ve got OO, use it:
<pre>class MyTestCase < Test::Unit::TestCase fixture :users end
class SomeTest < MyTestCase fixture :photos end</pre>
PS: Please upgrade typo.
I’ve attempted a couple times. I haven’t found an easy way to migrate my data forward without losing anything.