Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 63 lines (51 sloc) 1.714 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
# encoding: utf-8
$:.unshift(File.expand_path(File.dirname(__FILE__) + '/../')); $:.uniq!
require 'test_helper'

class I18nMemoizeBackendWithSimpleApiTest < Test::Unit::TestCase
  include I18n::Tests::Basics
  include I18n::Tests::Defaults
  include I18n::Tests::Interpolation
  include I18n::Tests::Link
  include I18n::Tests::Lookup
  include I18n::Tests::Pluralization
  include I18n::Tests::Procs
  include I18n::Tests::Localization::Date
  include I18n::Tests::Localization::DateTime
  include I18n::Tests::Localization::Time
  include I18n::Tests::Localization::Procs

  class MemoizeBackend < I18n::Backend::Simple
    include I18n::Backend::Memoize
  end

  def setup
    I18n.backend = MemoizeBackend.new
    super
  end

  test "make sure we use the MemoizeBackend backend" do
    assert_equal MemoizeBackend, I18n.backend.class
  end
end

I18n::Tests.setup_rufus_tokyo

class I18nMemoizeBackendWithKeyValueApiTest < Test::Unit::TestCase
  include I18n::Tests::Basics
  include I18n::Tests::Defaults
  include I18n::Tests::Interpolation
  include I18n::Tests::Link
  include I18n::Tests::Lookup
  include I18n::Tests::Pluralization
  include I18n::Tests::Localization::Date
  include I18n::Tests::Localization::DateTime
  include I18n::Tests::Localization::Time

  # include I18n::Tests::Procs
  # include I18n::Tests::Localization::Procs
  
  class MemoizeBackend < I18n::Backend::KeyValue
    include I18n::Backend::Memoize
  end

  STORE = Rufus::Tokyo::Cabinet.new('*')

  def setup
    I18n.backend = MemoizeBackend.new(STORE)
    super
  end
  
  test "make sure we use the MemoizeBackend backend" do
    assert_equal MemoizeBackend, I18n.backend.class
  end
end if defined?(Rufus::Tokyo::Cabinet)
Something went wrong with that request. Please try again.