Sha256: 272dff4fd635cbea3535035f6dacc9f936a296a18680b20993e482b3ef49b25f

Contents?: true

Size: 839 Bytes

Versions: 7

Compression:

Stored size: 839 Bytes

Contents

require "spec_helper"
require 'fast_gettext/po_file'

de_file = File.join('spec','locale','de','test.po')
de = FastGettext::PoFile.to_mo_file(de_file)

describe FastGettext::PoFile 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['Untranslated'].should == nil
  end

  it "finds pluralized values" do
    de.plural('Axis','Axis').should == ['Achse','Achsen']
  end

  it "returns empty array when pluralisation could not be found" do
    de.plural('Axis','Axis','Axis').should == []
  end

  it "can access plurals through []" do
    de['Axis'].should == 'Achse' #singular
  end

  it "unescapes '\\'" do
    de["You should escape '\\' as '\\\\'."].should == "Du solltest '\\' als '\\\\' escapen."
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fast_gettext-0.8.1 spec/fast_gettext/po_file_spec.rb
fast_gettext-0.8.0 spec/fast_gettext/po_file_spec.rb
fast_gettext-0.7.1 spec/fast_gettext/po_file_spec.rb
fast_gettext-0.7.0 spec/fast_gettext/po_file_spec.rb
fast_gettext-0.6.12 spec/fast_gettext/po_file_spec.rb
fast_gettext-0.6.11 spec/fast_gettext/po_file_spec.rb
fast_gettext-0.6.10 spec/fast_gettext/po_file_spec.rb