File: iconv_fallback.rb

package info (click to toggle)
ruby-fast-gettext 4.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 676 kB
  • sloc: ruby: 3,209; makefile: 4
file content (22 lines) | stat: -rw-r--r-- 514 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$LOAD_PATH.unshift 'lib'
$LOAD_PATH.unshift File.join('spec','cases','fake_load_path')

# test that iconv cannot be found
test = 1
begin
  require 'iconv'
rescue LoadError
  test = 2
end
raise unless test == 2

# use FastGettext like normal and see if it fails
require 'fast_gettext'

FastGettext.add_text_domain('test',:path=>File.join('spec','locale'))
FastGettext.text_domain = 'test'
FastGettext.available_locales = ['en','de']
FastGettext.locale = 'de'

#translate
raise unless FastGettext._('car') == 'Auto'