require "rubygems" require "ruby-debug" gem 'test-unit' require "test/unit" require 'active_support' require 'active_support/test_case' require 'active_record' require 'active_record/fixtures' require 'shoulda' require 'shoulda/active_record' this = File.expand_path(File.dirname(__FILE__)) require File.expand_path(File.join(this, '/../lib/acts-as-joinable')) ActsAsJoinable.models = Dir["#{this}/../app/models/*.rb"].collect { |f| File.basename f, '.rb' } Dir["#{this}/lib/*"].each { |c| require c if File.extname(c) == ".rb" } ActiveRecord::Base.class_eval do def self.detonate all.map(&:destroy) end end ActiveSupport::TestCase.class_eval do def create_models(parent = 1, child = 2) parent.times do |i| post = Post.create!(:title => "title-#{i.to_s}") child.times do |j| position = (i + 1) * (j + 1) asset = Asset.create!(:title => "asset-title-#{position.to_s}") tag = Tag.create!(:name => "tag-name-#{position.to_s}") end end end end