diff options
Diffstat (limited to 'vendor/plugins/globalize2/test/test_helper.rb')
| -rw-r--r-- | vendor/plugins/globalize2/test/test_helper.rb | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/vendor/plugins/globalize2/test/test_helper.rb b/vendor/plugins/globalize2/test/test_helper.rb deleted file mode 100644 index 195907d..0000000 --- a/vendor/plugins/globalize2/test/test_helper.rb +++ /dev/null | |||
| @@ -1,76 +0,0 @@ | |||
| 1 | $LOAD_PATH << File.expand_path( File.dirname(__FILE__) + '/../lib' ) | ||
| 2 | |||
| 3 | require 'rubygems' | ||
| 4 | require 'test/unit' | ||
| 5 | require 'active_record' | ||
| 6 | require 'active_support' | ||
| 7 | require 'active_support/test_case' | ||
| 8 | require 'mocha' | ||
| 9 | require 'globalize' | ||
| 10 | require 'validation_reflection' | ||
| 11 | |||
| 12 | config = { :adapter => 'sqlite3', :database => ':memory:' } | ||
| 13 | ActiveRecord::Base.establish_connection(config) | ||
| 14 | |||
| 15 | class ActiveSupport::TestCase | ||
| 16 | def reset_db!(schema_path = nil) | ||
| 17 | schema_path ||= File.expand_path(File.dirname(__FILE__) + '/data/schema.rb') | ||
| 18 | ActiveRecord::Migration.verbose = false | ||
| 19 | ActiveRecord::Base.silence { load(schema_path) } | ||
| 20 | end | ||
| 21 | |||
| 22 | def assert_member(item, array) | ||
| 23 | assert_block "Item #{item} is not in array #{array}" do | ||
| 24 | array.member?(item) | ||
| 25 | end | ||
| 26 | end | ||
| 27 | |||
| 28 | def assert_belongs_to(model, associated) | ||
| 29 | assert model.reflect_on_all_associations(:belongs_to).detect { |association| | ||
| 30 | association.name.to_s == associated.to_s | ||
| 31 | } | ||
| 32 | end | ||
| 33 | |||
| 34 | def assert_has_many(model, associated) | ||
| 35 | assert model.reflect_on_all_associations(:has_many).detect { |association| | ||
| 36 | association.name.to_s == associated.to_s | ||
| 37 | } | ||
| 38 | end | ||
| 39 | end | ||
| 40 | |||
| 41 | module ActiveRecord | ||
| 42 | module ConnectionAdapters | ||
| 43 | class AbstractAdapter | ||
| 44 | def index_exists?(table_name, column_name) | ||
| 45 | indexes(table_name).any? { |index| index.name == index_name(table_name, column_name) } | ||
| 46 | end | ||
| 47 | end | ||
| 48 | end | ||
| 49 | end | ||
| 50 | |||
| 51 | # module ActiveRecord | ||
| 52 | # class BaseWithoutTable < Base | ||
| 53 | # self.abstract_class = true | ||
| 54 | # | ||
| 55 | # def create_or_update | ||
| 56 | # errors.empty? | ||
| 57 | # end | ||
| 58 | # | ||
| 59 | # class << self | ||
| 60 | # def columns() | ||
| 61 | # @columns ||= [] | ||
| 62 | # end | ||
| 63 | # | ||
| 64 | # def column(name, sql_type = nil, default = nil, null = true) | ||
| 65 | # columns << ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type.to_s, null) | ||
| 66 | # reset_column_information | ||
| 67 | # end | ||
| 68 | # | ||
| 69 | # # Do not reset @columns | ||
| 70 | # def reset_column_information | ||
| 71 | # read_methods.each { |name| undef_method(name) } | ||
| 72 | # @column_names = @columns_hash = @content_columns = @dynamic_methods_hash = @read_methods = nil | ||
| 73 | # end | ||
| 74 | # end | ||
| 75 | # end | ||
| 76 | # end \ No newline at end of file | ||
