russian 0.6.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,51 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- require File.dirname(__FILE__) + '/spec_helper'
4
-
5
- describe Russian do
6
- describe "transliteration" do
7
- def t(str)
8
- Russian::transliterate(str)
9
- end
10
-
11
- %w(transliterate translit).each do |method|
12
- it "'#{method}' method should perform transliteration" do
13
- str = mock(:str)
14
- Russian::Transliteration.should_receive(:transliterate).with(str)
15
- Russian.send(method, str)
16
- end
17
- end
18
-
19
- # These tests are from rutils, <http://rutils.rubyforge.org>.
20
-
21
- it "should transliterate properly" do
22
- t("Это просто некий текст").should == "Eto prosto nekiy tekst"
23
- t("щ").should == "sch"
24
- t("стансы").should == "stansy"
25
- t("упущение").should == "upuschenie"
26
- t("ш").should == "sh"
27
- t("Ш").should == "SH"
28
- t("ц").should == "ts"
29
- end
30
-
31
- it "should properly transliterate mixed russian-english strings" do
32
- t("Это кусок строки русских букв v peremeshku s latinizey i амперсандом (pozor!) & something").should ==
33
- "Eto kusok stroki russkih bukv v peremeshku s latinizey i ampersandom (pozor!) & something"
34
- end
35
-
36
- it "should properly transliterate mixed case chars in a string" do
37
- t("НЕВЕРОЯТНОЕ УПУЩЕНИЕ").should == "NEVEROYATNOE UPUSCHENIE"
38
- t("Невероятное Упущение").should == "Neveroyatnoe Upuschenie"
39
- t("Шерстяной Заяц").should == "Sherstyanoy Zayats"
40
- t("Н.П. Шерстяков").should == "N.P. Sherstyakov"
41
- t("ШАРОВАРЫ").should == "SHAROVARY"
42
- end
43
-
44
- it "should work for multi-char substrings" do
45
- t("38 воробьёв").should == "38 vorobiev"
46
- t("Вася Воробьёв").should == "Vasya Vorobiev"
47
- t("Алябьев").should == "Alyabiev"
48
- t("АЛЯБЬЕВ").should == "ALYABIEV"
49
- end
50
- end
51
- end