Sha256: fce1664808919997b4c8fd09be906bdebc93b8643e2a950cbb46b7d7b511de2e

Contents?: true

Size: 1.27 KB

Versions: 1

Compression:

Stored size: 1.27 KB

Contents

# encoding: utf-8

$:.unshift "lib"

require 'rubygems'
require 'test/unit'
require 'mocha'
require 'i18n'
require 'time'
require 'yaml'

require File.dirname(__FILE__) + '/with_options'
require File.dirname(__FILE__) + '/backend/simple/setup'
require File.dirname(__FILE__) + '/backend/fast/setup'

Dir[File.dirname(__FILE__) + '/api/**/*.rb'].each do |filename|
  require filename
end

$KCODE = 'u' unless RUBY_VERSION >= '1.9'

class Test::Unit::TestCase
  def self.test(name, &block)
    define_method("test: " + name, &block)
  end

  def euc_jp(string)
    string.encode!(Encoding::EUC_JP)
  end
  
  def locales_dir
    File.dirname(__FILE__) + '/fixtures/locales'
  end

  def backend_store_translations(*args)
    I18n.backend.store_translations(*args)
  end

  def backend_get_translations
    I18n.backend.instance_variable_get :@translations
  end

  def date
    Date.new(2008, 3, 1)
  end

  def morning_datetime
    DateTime.new(2008, 3, 1, 6)
  end
  alias :datetime :morning_datetime

  def evening_datetime
    DateTime.new(2008, 3, 1, 18)
  end

  def morning_time
    Time.parse('2008-03-01 6:00 UTC')
  end
  alias :time :morning_time

  def evening_time
    Time.parse('2008-03-01 18:00 UTC')
  end
end

class Object
  def meta_class
    class << self; self; end
  end
end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
thedarkone-i18n-0.2.0 test/test_helper.rb