Sha256: e0865c42e12f3856b1df2f60c92dbd914ba1dc6525e7788fc50495117851bcae

Contents?: true

Size: 696 Bytes

Versions: 12

Compression:

Stored size: 696 Bytes

Contents

current_folder = File.dirname(__FILE__)
require File.join(current_folder,'..','spec_helper')

include FastGettext
de_file = File.join(current_folder,'..','locale','de','LC_MESSAGES','test.mo')
de = MoFile.new(de_file)

describe MoFile do
  before :all do
    File.exist?(de_file).should == true
  end
  it "parses a file" do
    de['car'].should == 'Auto'
  end
  it "stores untranslated values as nil" do
    de['Car|Model'].should == nil
  end
  it "finds pluralized values" do
    de.plural('Axis','Axis',1).should == 'Achse' #singular
    de.plural('Axis','Axis',2).should == 'Achsen' #plurals
  end
  it "can access plurals through []" do
    de['Axis'].should == 'Achse' #singular
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
grosser-fast_gettext-0.1.0 spec/fast_gettext/mo_file_spec.rb
grosser-fast_gettext-0.2.0 spec/fast_gettext/mo_file_spec.rb
grosser-fast_gettext-0.2.1 spec/fast_gettext/mo_file_spec.rb
grosser-fast_gettext-0.2.10 spec/fast_gettext/mo_file_spec.rb
grosser-fast_gettext-0.2.11 spec/fast_gettext/mo_file_spec.rb
grosser-fast_gettext-0.2.2 spec/fast_gettext/mo_file_spec.rb
grosser-fast_gettext-0.2.3 spec/fast_gettext/mo_file_spec.rb
grosser-fast_gettext-0.2.4 spec/fast_gettext/mo_file_spec.rb
grosser-fast_gettext-0.2.5 spec/fast_gettext/mo_file_spec.rb
grosser-fast_gettext-0.2.6 spec/fast_gettext/mo_file_spec.rb
grosser-fast_gettext-0.2.7 spec/fast_gettext/mo_file_spec.rb
grosser-fast_gettext-0.2.8 spec/fast_gettext/mo_file_spec.rb