From: Vassilis Rizopoulos Date: 2007-06-29T03:38:09+09:00 Subject: Getting fixtures to work without Rails Yes, this is ActiveRecord without Rails again. Specifically testing with fixtures. I'm stuck making them work and I know exactly where the code is checking out and leaving me in the dark. Now, the following will not load the fixtures and I want to know why. require 'rubygems' require 'active_record' require 'active_record/fixtures' require 'test/unit' class Schema "sqlite3",:database =>":memory:") Schema.up fixture_path=File.join(File.dirname(__FILE__)) use_instantiated_fixtures=true fixtures :entries def test_fixtures assert_equal(2,Entry.find(:all).size) end end Use the following in an entries.yml: new_entry: txt: "new entry" old_entry: txt: "old entry" I'm using active record 1.15.3. I followed the call chain all the way to a check in Test::Unit::testCase#setup_with_fixtures. The first line in that method is return unless defined?(ActiveRecord::Base) && !ActiveRecord::Base.configurations.blank? and the configurations are ofcourse blank :( So what am I missing? Obviously I need to recreate some more of that Rails magic. Cheers, V.- -- http://www.braveworld.net/riva