Sha256: 12d8a56bb5fad3547bd6573e446b36d740680ede20358cd0ed2cf24b8eaa953b

Contents?: true

Size: 756 Bytes

Versions: 4

Compression:

Stored size: 756 Bytes

Contents

require File.expand_path('spec/spec_helper')

describe 'Iconv' do
  before do
    @fake_load_path = File.join('spec','fast_gettext','vendor','fake_load_path')
  end

  after do
    $LOAD_PATH.delete @fake_load_path
  end

  it "also works when Iconv was not found locally" do
    #prepare load path
    $LOAD_PATH.unshift @fake_load_path
    test = 1
    begin
      require 'iconv'
    rescue LoadError
      test = 2
    end
    test.should == 2

    #load fast_gettext
    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
    FastGettext._('car').should == 'Auto'
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fast_gettext-0.6.0 spec/fast_gettext/vendor/iconv_spec.rb
fast_gettext-0.5.13 spec/fast_gettext/vendor/iconv_spec.rb
fast_gettext-0.5.12 spec/fast_gettext/vendor/iconv_spec.rb
fast_gettext-0.5.11 spec/fast_gettext/vendor/iconv_spec.rb