File: test_helper.rb

package info (click to toggle)
ruby-i18n-inflector 2.6.6-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 520 kB
  • ctags: 252
  • sloc: ruby: 2,513; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 671 bytes parent folder | download | duplicates (4)
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
require 'test/unit'
require 'test_declarative'
require 'i18n-inflector'

class Test::Unit::TestCase
  def teardown
    I18n.locale             = nil
    I18n.default_locale     = :en
    I18n.load_path          = []
    I18n.available_locales  = nil
    I18n.backend            = nil
  end if not method_defined?(:teardown)

  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

end

Object.class_eval do
  def meta_class
    class << self; self; end
  end
end unless Object.method_defined?(:meta_class)