Sha256: 2d62c6d61ac0cb26cad2840511343156ba62a29938c0b7742a942e57f7392f9d
Contents?: true
Size: 1.6 KB
Versions: 10
Compression:
Stored size: 1.6 KB
Contents
require File.dirname(__FILE__) + '/spec_helper' describe Russian do describe "transliteration" do def t(str) Russian::transliterate(str) end %w(transliterate translit).each do |method| it "'#{method}' method should perform transliteration" do str = mock(:str) Russian::Transliteration.should_receive(:transliterate).with(str) Russian.send(method, str) end end # These tests are from rutils, <http://rutils.rubyforge.org>. it "should transliterate properly" do t("Это просто некий текст").should == "Eto prosto nekiy tekst" t("щ").should == "sch" t("стансы").should == "stansyi" t("упущение").should == "upuschenie" t("ш").should == "sh" t("Ш").should == "SH" t("ц").should == "ts" end it "should properly transliterate mixed russian-english strings" do t("Это кусок строки русских букв v peremeshku s latinizey i амперсандом (pozor!) & something").should == "Eto kusok stroki russkih bukv v peremeshku s latinizey i ampersandom (pozor!) & something" end it "should properly transliterate mixed case chars in a string" do t("НЕВЕРОЯТНОЕ УПУЩЕНИЕ").should == "NEVEROYATNOE UPUSCHENIE" t("Невероятное Упущение").should == "Neveroyatnoe Upuschenie" t("Шерстяной Заяц").should == "Sherstyanoy Zayats" t("Н.П. Шерстяков").should == "N.P. Sherstyakov" t("ШАРОВАРЫ").should == "SHAROVARYI" end end end
Version data entries
10 entries across 10 versions & 2 rubygems