Updating to use Rails 2.1.2. Moving the gem dependancies to the config/environment.rb file. Moving the vendor/plugins externals into our svn.
This commit is contained in:
parent
38f4e17865
commit
252c2f7022
46 changed files with 3919 additions and 7 deletions
63
vendor/plugins/file_column/test/abstract_unit.rb
vendored
Normal file
63
vendor/plugins/file_column/test/abstract_unit.rb
vendored
Normal file
|
@ -0,0 +1,63 @@
|
|||
require 'test/unit'
|
||||
require 'rubygems'
|
||||
require 'active_support'
|
||||
require 'active_record'
|
||||
require 'action_view'
|
||||
require File.dirname(__FILE__) + '/connection'
|
||||
require 'stringio'
|
||||
|
||||
RAILS_ROOT = File.dirname(__FILE__)
|
||||
RAILS_ENV = ""
|
||||
|
||||
$: << "../lib"
|
||||
|
||||
require 'file_column'
|
||||
require 'file_compat'
|
||||
require 'validations'
|
||||
require 'test_case'
|
||||
|
||||
# do not use the file executable normally in our tests as
|
||||
# it may not be present on the machine we are running on
|
||||
FileColumn::ClassMethods::DEFAULT_OPTIONS =
|
||||
FileColumn::ClassMethods::DEFAULT_OPTIONS.merge({:file_exec => nil})
|
||||
|
||||
class ActiveRecord::Base
|
||||
include FileColumn
|
||||
include FileColumn::Validations
|
||||
end
|
||||
|
||||
|
||||
class RequestMock
|
||||
attr_accessor :relative_url_root
|
||||
|
||||
def initialize
|
||||
@relative_url_root = ""
|
||||
end
|
||||
end
|
||||
|
||||
class Test::Unit::TestCase
|
||||
|
||||
def assert_equal_paths(expected_path, path)
|
||||
assert_equal normalize_path(expected_path), normalize_path(path)
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
|
||||
def normalize_path(path)
|
||||
Pathname.new(path).realpath
|
||||
end
|
||||
|
||||
def clear_validations
|
||||
[:validate, :validate_on_create, :validate_on_update].each do |attr|
|
||||
Entry.write_inheritable_attribute attr, []
|
||||
Movie.write_inheritable_attribute attr, []
|
||||
end
|
||||
end
|
||||
|
||||
def file_path(filename)
|
||||
File.expand_path("#{File.dirname(__FILE__)}/fixtures/#{filename}")
|
||||
end
|
||||
|
||||
alias_method :f, :file_path
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue