Sha256: e0598a46836657bfd840801d093c4b3df8c08c4fd7464e72a2ef868952bc27a0
Contents?: true
Size: 1.84 KB
Versions: 1
Compression:
Stored size: 1.84 KB
Contents
# encoding: utf-8 $: << "lib" $: << File.expand_path(File.dirname(__FILE__)) require 'rubygems' require 'test/unit' require 'mocha' require 'i18n' require 'i18n/core_ext/object/meta_class' require 'time' require 'yaml' Dir[File.dirname(__FILE__) + '/api/**/*.rb'].each do |filename| require filename end $KCODE = 'u' unless RUBY_VERSION >= '1.9' # wtf is wrong with this, why's there Kernel#test? # class Module # def self.test(name, &block) # define_method("test: " + name, &block) # end # end class Test::Unit::TestCase def self.test(name, &block) define_method("test: " + name, &block) end def teardown I18n.locale = nil I18n.default_locale = :en I18n.load_path = [] I18n.available_locales = nil I18n.backend = nil end def translations I18n.backend.instance_variable_get(:@translations) end def store_translations(*args) data = args.pop locale = args.pop || :en I18n.backend.store_translations(locale, data) end def locales_dir File.dirname(__FILE__) + '/fixtures/locales' end def euc_jp(string) string.encode!(Encoding::EUC_JP) end end def setup_active_record require 'active_record' require 'i18n/backend/active_record/store_procs' if I18n::Backend::Simple.method_defined?(:interpolate_with_deprecated_syntax) I18n::Backend::Simple.send(:remove_method, :interpolate) rescue NameError end ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:") ActiveRecord::Migration.verbose = false ActiveRecord::Schema.define(:version => 1) do create_table :translations do |t| t.string :locale t.string :key t.string :value t.string :interpolations t.boolean :is_proc, :default => false end end I18n::Backend::ActiveRecord::Translation.send(:include, I18n::Backend::ActiveRecord::StoreProcs) end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
i18n-0.3.1 | test/test_helper.rb |