kittyverse 0.4.3 → 1.0.1

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.
data/test/helper.rb CHANGED
@@ -1,10 +1,10 @@
1
- ## $:.unshift(File.dirname(__FILE__))
2
-
3
- ## minitest setup
4
-
5
- require 'minitest/autorun'
6
-
7
-
8
- ## our own code
9
-
10
- require 'kittyverse'
1
+ ## $:.unshift(File.dirname(__FILE__))
2
+
3
+ ## minitest setup
4
+
5
+ require 'minitest/autorun'
6
+
7
+
8
+ ## our own code
9
+
10
+ require 'kittyverse'
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  ###
4
2
  # to run use
5
3
  # ruby -I ./lib -I ./test test/test_cattributes.rb
data/test/test_fancies.rb CHANGED
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  ###
4
2
  # to run use
5
3
  # ruby -I ./lib -I ./test test/test_fancies.rb
@@ -36,6 +34,22 @@ def test_bugcat_v2
36
34
  end
37
35
  end
38
36
 
37
+ def test_djmeowlody
38
+ [ Fancy[ 'DJ Meowlody' ],
39
+ Fancy[ :djmeowlody ]
40
+ ].each do |fancy|
41
+ assert_equal 'DJ Meowlody', fancy.name
42
+ assert_equal :djmeowlody, fancy.key
43
+ assert fancy.exclusive? == false
44
+ assert fancy.specialedition? == false
45
+ assert fancy.special_edition? == false
46
+
47
+ assert fancy.time?
48
+ assert fancy.recipe?
49
+ assert fancy.recipe.time?
50
+ assert 4, fancy.recipe.traits.size # ['happygokitty', 'ragdoll', 'tigerpunk', 'oceanid']
51
+ end
52
+ end
39
53
 
40
54
  def test_curdlin
41
55
  fancy = Fancy[ 'Curdlin' ]
@@ -0,0 +1,65 @@
1
+
2
+ =begin
3
+ pp genome[0].class
4
+ pp genome[0].name
5
+ pp genome[0].code
6
+
7
+ pp genome[5].class
8
+ pp genome[5].name
9
+ pp genome[5].code
10
+
11
+ pp genome[40].class
12
+ pp genome[40].name
13
+ pp genome[40].code
14
+
15
+
16
+ pp genome.body.class
17
+ pp genome.body.type.name
18
+ pp genome.body.type.code
19
+
20
+ pp genome[:body].class
21
+ pp genome[:body].type.name
22
+ pp genome[:body].type.code
23
+
24
+ pp genome.fu.class
25
+ pp genome.fu.type.name
26
+ pp genome.fu.type.code
27
+
28
+ pp genome[:FU].class
29
+ pp genome[:FU].type.name
30
+ pp genome[:FU].type.code
31
+
32
+ pp genome.body.d.class
33
+ pp genome.body.d.name
34
+ pp genome.body.d.code
35
+
36
+ pp genome[:body].d.class
37
+ pp genome[:body].d.name
38
+ pp genome[:body].d.code
39
+
40
+ pp genome.fu.d.class
41
+ pp genome.fu.d.name
42
+ pp genome.fu.d.code
43
+
44
+ pp genome.fu.r1.class
45
+ pp genome.fu.r1.name
46
+ pp genome.fu.r1.code
47
+
48
+ pp genome.body[0].class
49
+ pp genome.body[0].name
50
+ pp genome.body[0].code
51
+
52
+ pp genome.body[1].class
53
+ pp genome.body[1].name
54
+ pp genome.body[1].code
55
+
56
+ pp genome.fu[0].class
57
+ pp genome.fu[0].name
58
+ pp genome.fu[0].code
59
+
60
+ pp genome[:body][0].class
61
+ pp genome[:body][0].name
62
+ pp genome[:body][0].code
63
+ =end
64
+
65
+
data/test/test_traits.rb CHANGED
@@ -1,174 +1,172 @@
1
- # encoding: utf-8
2
-
3
- ###
4
- # to run use
5
- # ruby -I ./lib -I ./test test/test_traits.rb
6
-
7
-
8
- require 'helper'
9
-
10
-
11
- class TestTraits < MiniTest::Test
12
-
13
-
14
- def test_savannah
15
- [ Trait[ 'FU00' ],
16
- Trait.find_by_code( 'FU00' ),
17
- Trait.find_by( code: 'FU00' ),
18
- Trait[ 'savannah' ],
19
- Trait[ 'Savannah' ],
20
- Trait.find_by_name( 'Savannah' ),
21
- Trait.find_by( name: 'Savannah' ),
22
- Traits[ 'FU00' ],
23
- Traits[ 'savannah' ],
24
- Traits[ 'Savannah' ],
25
- Traits[ :body ][ '1' ],
26
- Traits[ :body ][ '00' ],
27
- Traits[ :body ][ 0 ],
28
- Traits['FU']['00'],
29
- Traits['FU'][0],
30
- Traits[:FU][0],
31
- Traits[:FU00],
32
- Traits['Fur'][0]
33
- ].each do |t|
34
- assert_equal Trait, t.class
35
- assert_equal "Savannah", t.name
36
- assert_equal "Fur", t.type.name
37
- assert_equal "FU00", t.code
38
- assert_equal "1", t.kai
39
- assert_equal 0, t.num
40
- assert_equal "00000", t.bin
41
- assert_equal "00000", t.binary
42
- assert_equal 0, t.tier
43
- assert_equal "", t.tier_roman
44
- assert_equal "", t.tier(:roman)
45
- assert t.base?
46
- assert t.m1? == false
47
- assert t.m2? == false
48
- assert t.m3? == false
49
- assert t.m4? == false
50
- end
51
- end
52
-
53
- def test_moonrise
54
- t = Trait[ 'Moonrise' ]
55
- assert_equal "PA30", t.code
56
- assert_equal "w", t.kai
57
- assert_equal 30, t.num
58
- assert_equal "11110", t.bin
59
- assert_equal "11110", t.binary
60
- assert_equal 4, t.tier
61
- assert_equal 4, t.level
62
- assert_equal 4, t.m
63
- assert_equal "IIII", t.tier_roman
64
- assert_equal "IIII", t.tier(:roman)
65
- assert_equal "IIII", t.level(:roman)
66
- assert_equal "IIII", t.m(:roman)
67
- assert t.base? == false
68
- assert t.m1? == false
69
- assert t.m2? == false
70
- assert t.m3? == false
71
- assert t.m4?
72
- end
73
-
74
-
75
- def test_totesbasic
76
- [ Trait.find_by_name( 'totesbasic 1' ),
77
- Trait.find_by_name( 'totesbasic_1' ),
78
- Trait.find_by_name( 'totesbasic (14)' ),
79
- Trait.find_by_name( 'totesbasic_14' ),
80
- Trait.find_by_name( 'totesbasic (f)' ),
81
- Trait.find_by_name( 'totesbasic_f' ),
82
- Trait[ 'totesbasic 1' ],
83
- Trait[ 'totesbasic_1' ],
84
- ].each do |t|
85
- assert_equal Trait, t.class
86
- assert_equal "Totesbasic 1", t.name
87
- assert_equal "Pattern", t.type.name
88
- assert_equal "PA14", t.code
89
- assert_equal "f", t.kai
90
- assert_equal 14, t.num
91
- assert t.base?
92
- assert_equal 0, t.tier
93
- assert_equal "", t.tier_roman
94
- assert_equal "", t.tier(:roman)
95
- end
96
- end
97
-
98
-
99
- def test_fu31
100
- [ Traits[ :body ][ 'x' ],
101
- Traits[ :body ][ '31' ],
102
- Traits[ :body ][ 31 ]
103
- ].each do |t|
104
- assert_equal Trait, t.class
105
- assert t.name == nil
106
- assert_equal "Fur", t.type.name
107
- assert_equal "FU31", t.code
108
- assert_equal "x", t.kai
109
- assert_equal 31, t.num
110
- assert_equal "11111", t.bin
111
- assert_equal "11111", t.binary
112
- assert t.tier == nil
113
- assert t.level == nil
114
- assert t.m == nil
115
- assert_equal "", t.tier_roman
116
- assert_equal "", t.tier(:roman)
117
- assert_equal "", t.level(:roman)
118
- assert_equal "", t.m(:roman)
119
- assert t.base? == false
120
- assert t.m1? == false
121
- assert t.m2? == false
122
- assert t.m3? == false
123
- assert t.m4? == false
124
- end
125
- end
126
-
127
- def test_vigilante
128
- [ Traits['Pattern'][0],
129
- Traits['PA00'],
130
- Traits['Vigilante']
131
- ].each do |t|
132
- assert_equal Trait, t.class
133
- assert_equal "Vigilante", t.name
134
- assert_equal "Pattern", t.type.name
135
- assert_equal "PA00", t.code
136
- assert_equal "1", t.kai
137
- assert_equal 0, t.num
138
- end
139
- end
140
-
141
- def test_body
142
- [ Traits[ :body ],
143
- TraitType.find_by_key( :body ),
144
- TraitType.find_by( :key => :body )
145
- ].each do |tt|
146
- assert_equal TraitType, tt.class
147
- assert_equal "Fur", tt.name
148
- assert_equal :body, tt.key
149
- assert_equal 32, tt.traits.size
150
- end
151
- end
152
-
153
-
154
-
155
-
156
- def test_each
157
- Traits.each do |type|
158
- puts "#{type.key} => #{type.name} (#{type.code}), genes #{type.genes}"
159
- end
160
-
161
- Traits.each_with_index do |type,i|
162
- puts "#{i}: #{type.key} => #{type.name} (#{type.code}), genes #{type.genes}"
163
- end
164
-
165
- TraitType.each do |type|
166
- puts "#{type.key} => #{type.name} (#{type.code}), genes #{type.genes}"
167
- end
168
-
169
- TraitType.each_with_index do |type,i|
170
- puts "#{i}: #{type.key} => #{type.name} (#{type.code}), genes #{type.genes}"
171
- end
172
- end
173
-
174
- end # class TestTraits
1
+ ###
2
+ # to run use
3
+ # ruby -I ./lib -I ./test test/test_traits.rb
4
+
5
+
6
+ require 'helper'
7
+
8
+
9
+ class TestTraits < MiniTest::Test
10
+
11
+
12
+ def test_savannah
13
+ [ Trait[ 'FU00' ],
14
+ Trait.find_by_code( 'FU00' ),
15
+ Trait.find_by( code: 'FU00' ),
16
+ Trait[ 'savannah' ],
17
+ Trait[ 'Savannah' ],
18
+ Trait.find_by_name( 'Savannah' ),
19
+ Trait.find_by( name: 'Savannah' ),
20
+ Traits[ 'FU00' ],
21
+ Traits[ 'savannah' ],
22
+ Traits[ 'Savannah' ],
23
+ Traits[ :body ][ '1' ],
24
+ Traits[ :body ][ '00' ],
25
+ Traits[ :body ][ 0 ],
26
+ Traits['FU']['00'],
27
+ Traits['FU'][0],
28
+ Traits[:FU][0],
29
+ Traits[:FU00],
30
+ Traits['Fur'][0]
31
+ ].each do |t|
32
+ assert_equal Trait, t.class
33
+ assert_equal "Savannah", t.name
34
+ assert_equal "Fur", t.type.name
35
+ assert_equal "FU00", t.code
36
+ assert_equal "1", t.kai
37
+ assert_equal 0, t.num
38
+ assert_equal "00000", t.bin
39
+ assert_equal "00000", t.binary
40
+ assert_equal 0, t.tier
41
+ assert_equal "", t.tier_roman
42
+ assert_equal "", t.tier(:roman)
43
+ assert t.base?
44
+ assert t.m1? == false
45
+ assert t.m2? == false
46
+ assert t.m3? == false
47
+ assert t.m4? == false
48
+ end
49
+ end
50
+
51
+ def test_moonrise
52
+ t = Trait[ 'Moonrise' ]
53
+ assert_equal "PA30", t.code
54
+ assert_equal "w", t.kai
55
+ assert_equal 30, t.num
56
+ assert_equal "11110", t.bin
57
+ assert_equal "11110", t.binary
58
+ assert_equal 4, t.tier
59
+ assert_equal 4, t.level
60
+ assert_equal 4, t.m
61
+ assert_equal "IIII", t.tier_roman
62
+ assert_equal "IIII", t.tier(:roman)
63
+ assert_equal "IIII", t.level(:roman)
64
+ assert_equal "IIII", t.m(:roman)
65
+ assert t.base? == false
66
+ assert t.m1? == false
67
+ assert t.m2? == false
68
+ assert t.m3? == false
69
+ assert t.m4?
70
+ end
71
+
72
+
73
+ def test_totesbasic
74
+ [ Trait.find_by_name( 'totesbasic 1' ),
75
+ Trait.find_by_name( 'totesbasic_1' ),
76
+ Trait.find_by_name( 'totesbasic (14)' ),
77
+ Trait.find_by_name( 'totesbasic_14' ),
78
+ Trait.find_by_name( 'totesbasic (f)' ),
79
+ Trait.find_by_name( 'totesbasic_f' ),
80
+ Trait[ 'totesbasic 1' ],
81
+ Trait[ 'totesbasic_1' ],
82
+ ].each do |t|
83
+ assert_equal Trait, t.class
84
+ assert_equal "Totesbasic 1", t.name
85
+ assert_equal "Pattern", t.type.name
86
+ assert_equal "PA14", t.code
87
+ assert_equal "f", t.kai
88
+ assert_equal 14, t.num
89
+ assert t.base?
90
+ assert_equal 0, t.tier
91
+ assert_equal "", t.tier_roman
92
+ assert_equal "", t.tier(:roman)
93
+ end
94
+ end
95
+
96
+
97
+ def test_fu31
98
+ [ Traits[ :body ][ 'x' ],
99
+ Traits[ :body ][ '31' ],
100
+ Traits[ :body ][ 31 ]
101
+ ].each do |t|
102
+ assert_equal Trait, t.class
103
+ assert t.name == nil
104
+ assert_equal "Fur", t.type.name
105
+ assert_equal "FU31", t.code
106
+ assert_equal "x", t.kai
107
+ assert_equal 31, t.num
108
+ assert_equal "11111", t.bin
109
+ assert_equal "11111", t.binary
110
+ assert t.tier == nil
111
+ assert t.level == nil
112
+ assert t.m == nil
113
+ assert_equal "", t.tier_roman
114
+ assert_equal "", t.tier(:roman)
115
+ assert_equal "", t.level(:roman)
116
+ assert_equal "", t.m(:roman)
117
+ assert t.base? == false
118
+ assert t.m1? == false
119
+ assert t.m2? == false
120
+ assert t.m3? == false
121
+ assert t.m4? == false
122
+ end
123
+ end
124
+
125
+ def test_vigilante
126
+ [ Traits['Pattern'][0],
127
+ Traits['PA00'],
128
+ Traits['Vigilante']
129
+ ].each do |t|
130
+ assert_equal Trait, t.class
131
+ assert_equal "Vigilante", t.name
132
+ assert_equal "Pattern", t.type.name
133
+ assert_equal "PA00", t.code
134
+ assert_equal "1", t.kai
135
+ assert_equal 0, t.num
136
+ end
137
+ end
138
+
139
+ def test_body
140
+ [ Traits[ :body ],
141
+ TraitType.find_by_key( :body ),
142
+ TraitType.find_by( :key => :body )
143
+ ].each do |tt|
144
+ assert_equal TraitType, tt.class
145
+ assert_equal "Fur", tt.name
146
+ assert_equal :body, tt.key
147
+ assert_equal 32, tt.traits.size
148
+ end
149
+ end
150
+
151
+
152
+
153
+
154
+ def test_each
155
+ Traits.each do |type|
156
+ puts "#{type.key} => #{type.name} (#{type.code}), genes #{type.genes}"
157
+ end
158
+
159
+ Traits.each_with_index do |type,i|
160
+ puts "#{i}: #{type.key} => #{type.name} (#{type.code}), genes #{type.genes}"
161
+ end
162
+
163
+ TraitType.each do |type|
164
+ puts "#{type.key} => #{type.name} (#{type.code}), genes #{type.genes}"
165
+ end
166
+
167
+ TraitType.each_with_index do |type,i|
168
+ puts "#{i}: #{type.key} => #{type.name} (#{type.code}), genes #{type.genes}"
169
+ end
170
+ end
171
+
172
+ end # class TestTraits