reality-naming 1.12.0 → 1.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/reality/naming.rb +1 -1
- data/reality-naming.gemspec +1 -1
- data/test/test_naming.rb +20 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 543ab9533c5563d6997edfa56dc79b07787b602c
|
4
|
+
data.tar.gz: f2c2f4184d96927216338ce52ee182389a2c8ff8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d83be2d6337ae398f7b4673bfc257229b6a6c868072359a625690fd0b9e2ed555aa68251bbf7d724ff630c85d294e9b4f165b5f44b7ce97fe01357c5998fad3
|
7
|
+
data.tar.gz: 2d4cc2d192a7b0b5a4025144a231b9a38ec637592838b4ebc12df16b1e6fdda23ebf2f16033fc886bb306140d810d0c866ea626524325cd3cd34930cae459aea
|
data/lib/reality/naming.rb
CHANGED
data/reality-naming.gemspec
CHANGED
data/test/test_naming.rb
CHANGED
@@ -33,6 +33,26 @@ class TestNaming < Reality::Naming::TestCase
|
|
33
33
|
assert_equal 'cats', Reality::Naming.pluralize('cat')
|
34
34
|
end
|
35
35
|
|
36
|
+
def test_custom_pluralization_rules_ordering
|
37
|
+
assert_equal 'cats', Reality::Naming.pluralize('cat')
|
38
|
+
Reality::Naming.add_pluralization_rule do |string|
|
39
|
+
string == 'cat' ? 'catz' : nil
|
40
|
+
end
|
41
|
+
assert_equal 'catz', Reality::Naming.pluralize('cat')
|
42
|
+
Reality::Naming.add_pluralization_rule do |string|
|
43
|
+
string == 'cat' ? 'cattles' : nil
|
44
|
+
end
|
45
|
+
assert_equal 'cattles', Reality::Naming.pluralize('cat')
|
46
|
+
end
|
47
|
+
|
48
|
+
def test_custom_pluralization_overlap_with_defaults
|
49
|
+
assert_equal 'IsAsGoodAses', Reality::Naming.pluralize('IsAsGoodAs')
|
50
|
+
Reality::Naming.add_pluralization_rule do |string|
|
51
|
+
string.to_s == 'IsAsGoodAs' ? 'IsAsGoodAsSet' : nil
|
52
|
+
end
|
53
|
+
assert_equal 'IsAsGoodAsSet', Reality::Naming.pluralize('IsAsGoodAs')
|
54
|
+
end
|
55
|
+
|
36
56
|
def test_default_pluralization_rules
|
37
57
|
assert_equal 'children', Reality::Naming.pluralize('child')
|
38
58
|
assert_equal 'Children', Reality::Naming.pluralize('Child')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reality-naming
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Donald
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|