Sha256: 5d2328ea89cb06e60450cfb34d20f1fd9ce371935980306ab87b62c360797f72
Contents?: true
Size: 999 Bytes
Versions: 7
Compression:
Stored size: 999 Bytes
Contents
require "spec_helper" describe 'FastGettext::TranslationRepository::Mo' do before do @rep = FastGettext::TranslationRepository.build('test',:path=>File.join('spec', 'locale')) @rep.is_a?(FastGettext::TranslationRepository::Mo).should be_true end it "can be built" do @rep.available_locales.sort.should == ['de','en','gsw_CH'] end it "can translate" do FastGettext.locale = 'de' @rep['car'].should == 'Auto' end it "can pluralize" do FastGettext.locale = 'de' @rep.plural('Axis','Axis').should == ['Achse','Achsen'] end it "has access to the mo repositories pluralisation rule" do FastGettext.locale = 'en' rep = FastGettext::TranslationRepository.build('plural_test',:path=>File.join('spec','locale')) rep['car'].should == 'Test'#just check it is loaded correctly rep.pluralisation_rule.call(2).should == 3 end it "can work in SAFE mode" do `ruby spec/cases/safe_mode_can_handle_locales.rb 2>&1`.should == 'true' end end
Version data entries
7 entries across 7 versions & 1 rubygems