unicode_case_converter 0.3.0 → 0.4.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.
- checksums.yaml +4 -4
- data/lib/unicode_case_converter/version.rb +1 -1
- data/lib/unicode_case_converter.rb +1 -1
- data/spec/unicode_case_converter_spec.rb +13 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f0da6506aa19279d3428441d416550fbc6aa724
|
4
|
+
data.tar.gz: ce9a69dd5bc531912a724584f48391d66249ffd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37edef63b66062808532164522e3578397a09f235dffbd01e7d389d0342858528a89f7158a28f87422c95040f227fd9d1f7a796749775aa1e63590dd7aab994a
|
7
|
+
data.tar.gz: ad6cf449eacd402e51fabe8ab5a1611bbaefd2799bcbdb8ec61c6d5674208b335ae10dafa46f0e60c205a266b54042487c1ebeeac593874cf9307115655958bf
|
@@ -157,7 +157,7 @@ module UnicodeCaseConverter
|
|
157
157
|
end
|
158
158
|
|
159
159
|
def capitalize
|
160
|
-
UnicodeCaseConverter::Converter.new(
|
160
|
+
UnicodeCaseConverter::Converter.new(text.slice(0,1)).upcase + UnicodeCaseConverter::Converter.new(text).downcase.slice(1..-1)
|
161
161
|
end
|
162
162
|
end
|
163
163
|
end
|
@@ -43,6 +43,13 @@ describe UnicodeCaseConverter do
|
|
43
43
|
expect(ucc.capitalize).to eq(unicode_result)
|
44
44
|
end
|
45
45
|
|
46
|
+
it "capitalizes a string 3" do
|
47
|
+
text = "hello World".freeze
|
48
|
+
ucc = UnicodeCaseConverter::Converter.new(text)
|
49
|
+
unicode_result = Unicode.capitalize(text)
|
50
|
+
expect(ucc.capitalize).to eq(unicode_result)
|
51
|
+
end
|
52
|
+
|
46
53
|
# (0..3).each do |first_digit|
|
47
54
|
# [*'0'..'9', *'A'..'F'].sample(16).sort.each do |second_digit|
|
48
55
|
# [*'0'..'9', *'A'..'F'].sample(16).sort.each do |third_digit|
|
@@ -142,6 +149,9 @@ describe UnicodeCaseConverter do
|
|
142
149
|
5.times do
|
143
150
|
UnicodeCaseConverter::Converter.new(string).upcase
|
144
151
|
end
|
152
|
+
5.times do
|
153
|
+
UnicodeCaseConverter::Converter.new(string).capitalize
|
154
|
+
end
|
145
155
|
end
|
146
156
|
end
|
147
157
|
|
@@ -155,6 +165,9 @@ describe UnicodeCaseConverter do
|
|
155
165
|
5.times do
|
156
166
|
Unicode::upcase(string)
|
157
167
|
end
|
168
|
+
5.times do
|
169
|
+
Unicode::capitalize(string)
|
170
|
+
end
|
158
171
|
end
|
159
172
|
end
|
160
173
|
end
|