3 require 'active_support'
4 require 'active_record'
6 require File.dirname(__FILE__) + '/connection'
9 RAILS_ROOT = File.dirname(__FILE__)
19 # do not use the file executable normally in our tests as
20 # it may not be present on the machine we are running on
21 FileColumn::ClassMethods::DEFAULT_OPTIONS =
22 FileColumn::ClassMethods::DEFAULT_OPTIONS.merge({:file_exec => nil})
24 class ActiveRecord::Base
26 include FileColumn::Validations
31 attr_accessor :relative_url_root
34 @relative_url_root = ""
38 class Test::Unit::TestCase
40 def assert_equal_paths(expected_path, path)
41 assert_equal normalize_path(expected_path), normalize_path(path)
47 def normalize_path(path)
48 Pathname.new(path).realpath
52 [:validate, :validate_on_create, :validate_on_update].each do |attr|
53 Entry.write_inheritable_attribute attr, []
54 Movie.write_inheritable_attribute attr, []
58 def file_path(filename)
59 File.expand_path("#{File.dirname(__FILE__)}/fixtures/#{filename}")
62 alias_method :f, :file_path