lol_api 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +22 -0
  3. data/.guardfile +11 -0
  4. data/.travis.yml +6 -0
  5. data/Gemfile +10 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +29 -0
  8. data/Rakefile +10 -0
  9. data/lib/lol_api/client.rb +105 -0
  10. data/lib/lol_api/configuration.rb +15 -0
  11. data/lib/lol_api/connection.rb +32 -0
  12. data/lib/lol_api/types/champion.rb +95 -0
  13. data/lib/lol_api/types/dtos/image.rb +33 -0
  14. data/lib/lol_api/types/dtos/info.rb +25 -0
  15. data/lib/lol_api/types/dtos/participant.rb +419 -0
  16. data/lib/lol_api/types/dtos/participant_identity.rb +19 -0
  17. data/lib/lol_api/types/dtos/passive.rb +27 -0
  18. data/lib/lol_api/types/dtos/player.rb +22 -0
  19. data/lib/lol_api/types/dtos/recommended.rb +38 -0
  20. data/lib/lol_api/types/dtos/skin.rb +20 -0
  21. data/lib/lol_api/types/dtos/spell.rb +98 -0
  22. data/lib/lol_api/types/dtos/stat.rb +19 -0
  23. data/lib/lol_api/types/dtos/team.rb +57 -0
  24. data/lib/lol_api/types/dtos/timeline.rb +180 -0
  25. data/lib/lol_api/types/history_match.rb +61 -0
  26. data/lib/lol_api/types/item.rb +126 -0
  27. data/lib/lol_api/types/mastery.rb +39 -0
  28. data/lib/lol_api/types/match.rb +43 -0
  29. data/lib/lol_api/types/summoner.rb +26 -0
  30. data/lib/lol_api/types/summoner_masteries.rb +66 -0
  31. data/lib/lol_api/types/summoner_runes.rb +69 -0
  32. data/lib/lol_api/utils/inspectable.rb +10 -0
  33. data/lib/lol_api/version.rb +3 -0
  34. data/lib/lol_api.rb +12 -0
  35. data/lol_api.gemspec +29 -0
  36. data/spec/champion_spec.rb +48 -0
  37. data/spec/client_spec.rb +67 -0
  38. data/spec/delegation_spec.rb +5 -0
  39. data/spec/factories.rb +43 -0
  40. data/spec/fixtures/champion.json +843 -0
  41. data/spec/fixtures/history.json +127 -0
  42. data/spec/fixtures/item.json +62 -0
  43. data/spec/fixtures/mastery.json +25 -0
  44. data/spec/fixtures/match.json +12167 -0
  45. data/spec/fixtures/match_details.json +13548 -0
  46. data/spec/fixtures/summoner.json +7 -0
  47. data/spec/fixtures/summoner_masteries.json +143 -0
  48. data/spec/fixtures/summoner_runes.json +132 -0
  49. data/spec/history_spec.rb +280 -0
  50. data/spec/item_spec.rb +96 -0
  51. data/spec/mastery_spec.rb +27 -0
  52. data/spec/match_details_spec.rb +72 -0
  53. data/spec/participant_spec.rb +153 -0
  54. data/spec/participant_timeline_spec.rb +80 -0
  55. data/spec/spec_helper.rb +22 -0
  56. data/spec/summoner_spec.rb +120 -0
  57. data/spec/team_spec.rb +38 -0
  58. data/spec/timeline_spec.rb +101 -0
  59. metadata +236 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "id": 332541,
3
+ "name": "furryballs",
4
+ "profileIconId": 28,
5
+ "revisionDate": 1408047409000,
6
+ "summonerLevel": 30
7
+ }
@@ -0,0 +1,143 @@
1
+ {
2
+ "pages": [
3
+ {
4
+ "masteries": [
5
+ {
6
+ "id": 4212,
7
+ "rank": 2
8
+ },
9
+ {
10
+ "id": 4211,
11
+ "rank": 2
12
+ },
13
+ {
14
+ "id": 4124,
15
+ "rank": 1
16
+ },
17
+ {
18
+ "id": 4154,
19
+ "rank": 1
20
+ },
21
+ {
22
+ "id": 4114,
23
+ "rank": 1
24
+ },
25
+ {
26
+ "id": 4222,
27
+ "rank": 3
28
+ },
29
+ {
30
+ "id": 4113,
31
+ "rank": 4
32
+ },
33
+ {
34
+ "id": 4221,
35
+ "rank": 1
36
+ },
37
+ {
38
+ "id": 4152,
39
+ "rank": 3
40
+ },
41
+ {
42
+ "id": 4123,
43
+ "rank": 3
44
+ },
45
+ {
46
+ "id": 4111,
47
+ "rank": 1
48
+ },
49
+ {
50
+ "id": 4134,
51
+ "rank": 2
52
+ },
53
+ {
54
+ "id": 4133,
55
+ "rank": 1
56
+ },
57
+ {
58
+ "id": 4232,
59
+ "rank": 1
60
+ },
61
+ {
62
+ "id": 4143,
63
+ "rank": 3
64
+ },
65
+ {
66
+ "id": 4162,
67
+ "rank": 1
68
+ }
69
+ ],
70
+ "id": 43675928,
71
+ "name": "AP Carry",
72
+ "current": false
73
+ },
74
+ {
75
+ "masteries": [
76
+ {
77
+ "id": 4211,
78
+ "rank": 2
79
+ },
80
+ {
81
+ "id": 4134,
82
+ "rank": 3
83
+ },
84
+ {
85
+ "id": 4213,
86
+ "rank": 2
87
+ },
88
+ {
89
+ "id": 4212,
90
+ "rank": 1
91
+ },
92
+ {
93
+ "id": 4124,
94
+ "rank": 1
95
+ },
96
+ {
97
+ "id": 4114,
98
+ "rank": 1
99
+ },
100
+ {
101
+ "id": 4151,
102
+ "rank": 1
103
+ },
104
+ {
105
+ "id": 4112,
106
+ "rank": 4
107
+ },
108
+ {
109
+ "id": 4222,
110
+ "rank": 3
111
+ },
112
+ {
113
+ "id": 4122,
114
+ "rank": 3
115
+ },
116
+ {
117
+ "id": 4152,
118
+ "rank": 3
119
+ },
120
+ {
121
+ "id": 4132,
122
+ "rank": 1
123
+ },
124
+ {
125
+ "id": 4142,
126
+ "rank": 3
127
+ },
128
+ {
129
+ "id": 4232,
130
+ "rank": 1
131
+ },
132
+ {
133
+ "id": 4162,
134
+ "rank": 1
135
+ }
136
+ ],
137
+ "id": 43675929,
138
+ "name": "AD Carry",
139
+ "current": true
140
+ }
141
+ ],
142
+ "summonerId": 332541
143
+ }
@@ -0,0 +1,132 @@
1
+ {
2
+ "pages": [
3
+ {
4
+ "id": 14741205,
5
+ "slots": [
6
+ {
7
+ "runeId": 5246,
8
+ "runeSlotId": 1
9
+ },
10
+ {
11
+ "runeId": 5246,
12
+ "runeSlotId": 2
13
+ },
14
+ {
15
+ "runeId": 5246,
16
+ "runeSlotId": 3
17
+ },
18
+ {
19
+ "runeId": 5246,
20
+ "runeSlotId": 4
21
+ },
22
+ {
23
+ "runeId": 5246,
24
+ "runeSlotId": 5
25
+ },
26
+ {
27
+ "runeId": 5246,
28
+ "runeSlotId": 6
29
+ },
30
+ {
31
+ "runeId": 5246,
32
+ "runeSlotId": 7
33
+ },
34
+ {
35
+ "runeId": 5246,
36
+ "runeSlotId": 8
37
+ },
38
+ {
39
+ "runeId": 5246,
40
+ "runeSlotId": 9
41
+ },
42
+ {
43
+ "runeId": 5316,
44
+ "runeSlotId": 10
45
+ },
46
+ {
47
+ "runeId": 5316,
48
+ "runeSlotId": 11
49
+ },
50
+ {
51
+ "runeId": 5316,
52
+ "runeSlotId": 12
53
+ },
54
+ {
55
+ "runeId": 5316,
56
+ "runeSlotId": 13
57
+ },
58
+ {
59
+ "runeId": 5316,
60
+ "runeSlotId": 14
61
+ },
62
+ {
63
+ "runeId": 5316,
64
+ "runeSlotId": 15
65
+ },
66
+ {
67
+ "runeId": 5316,
68
+ "runeSlotId": 16
69
+ },
70
+ {
71
+ "runeId": 5316,
72
+ "runeSlotId": 17
73
+ },
74
+ {
75
+ "runeId": 5316,
76
+ "runeSlotId": 18
77
+ },
78
+ {
79
+ "runeId": 5290,
80
+ "runeSlotId": 19
81
+ },
82
+ {
83
+ "runeId": 5290,
84
+ "runeSlotId": 20
85
+ },
86
+ {
87
+ "runeId": 5290,
88
+ "runeSlotId": 21
89
+ },
90
+ {
91
+ "runeId": 5290,
92
+ "runeSlotId": 22
93
+ },
94
+ {
95
+ "runeId": 5290,
96
+ "runeSlotId": 23
97
+ },
98
+ {
99
+ "runeId": 5290,
100
+ "runeSlotId": 24
101
+ },
102
+ {
103
+ "runeId": 5290,
104
+ "runeSlotId": 25
105
+ },
106
+ {
107
+ "runeId": 5290,
108
+ "runeSlotId": 26
109
+ },
110
+ {
111
+ "runeId": 5290,
112
+ "runeSlotId": 27
113
+ },
114
+ {
115
+ "runeId": 5343,
116
+ "runeSlotId": 28
117
+ },
118
+ {
119
+ "runeId": 5343,
120
+ "runeSlotId": 29
121
+ },
122
+ {
123
+ "runeId": 5343,
124
+ "runeSlotId": 30
125
+ }
126
+ ],
127
+ "name": "AD Carry",
128
+ "current": true
129
+ }
130
+ ],
131
+ "summonerId": 332541
132
+ }
@@ -0,0 +1,280 @@
1
+ require 'spec_helper'
2
+
3
+ describe LolApi::HistoryMatch do
4
+ before do
5
+ @history = FactoryGirl.build(:history_match)
6
+ end
7
+ subject { @history }
8
+
9
+ it { should be_kind_of(LolApi::HistoryMatch)}
10
+ it { should respond_to(:map_id) }
11
+ it { should respond_to(:match_creation) }
12
+ it { should respond_to(:match_duration) }
13
+ it { should respond_to(:match_id) }
14
+ it { should respond_to(:match_version) }
15
+ it { should respond_to(:participant_identities) }
16
+ it { should respond_to(:participants) }
17
+ it { should respond_to(:queue_type) }
18
+ it { should respond_to(:region) }
19
+ it { should respond_to(:season) }
20
+
21
+ describe "must return" do
22
+ its(:map_id) { should eq 1 }
23
+ its(:match_creation) { should eq 1403301139393 }
24
+ its(:match_duration) { should eq 2615 }
25
+ its(:match_id) { should eq 1535572376}
26
+ its(:match_version) { should eq "4.10.0.379" }
27
+ its(:participant_identities) { should_not be_empty}
28
+ its(:participants) { should_not be_empty }
29
+ its(:queue_type) { should eq "RANKED_SOLO_5x5" }
30
+ its(:region) { should eq "EUW" }
31
+ its(:season) { should eq "SEASON4" }
32
+ end
33
+
34
+ describe "participant identites" do
35
+ subject { @history.participant_identities.first }
36
+
37
+ describe "should respond to" do
38
+ it { should respond_to(:participant_id) }
39
+ it { should respond_to(:player) }
40
+ end
41
+
42
+ describe "must return" do
43
+ its(:participant_id) { should eq 0 }
44
+ its(:player) { should be_kind_of(LolApi::Player) }
45
+ end
46
+
47
+ describe "participant player" do
48
+ subject { @history.participant_identities[0].player }
49
+
50
+ describe "should respond to" do
51
+ it { should respond_to(:match_history_uri) }
52
+ it { should respond_to(:profile_icon) }
53
+ it { should respond_to(:summoner_name) }
54
+ end
55
+
56
+ describe "must return" do
57
+ its(:match_history_uri) { should eq "/v1/stats/player_history/EUW1/338263" }
58
+ its(:profile_icon) { should eq 28}
59
+ its(:summoner_name) { should eq "furryballs" }
60
+ end
61
+ end
62
+ end
63
+
64
+ describe "participant" do
65
+ subject(:participant) { @history.participants.first }
66
+
67
+ it { should respond_to(:champion_id) }
68
+ it { should respond_to(:participant_id) }
69
+ it { should respond_to(:spell_1) }
70
+ it { should respond_to(:spell_2) }
71
+ it { should respond_to(:stats) }
72
+ it { should respond_to(:team_id) }
73
+
74
+ describe "should return" do
75
+ its(:champion_id) { should eq 222 }
76
+ its(:participant_id) { should eq 0 }
77
+ its(:spell_1) { should eq 7 }
78
+ its(:spell_2) { should eq 4 }
79
+ its(:stats) { should be_kind_of(LolApi::ParticipantStats) }
80
+ its(:team_id) { should eq 200 }
81
+ end
82
+
83
+ describe "stats" do
84
+ subject { participant.stats }
85
+
86
+ it { should respond_to(:assists) }
87
+ it { should respond_to(:champ_level) }
88
+ it { should respond_to(:combat_player_score) }
89
+ it { should respond_to(:deaths) }
90
+ it { should respond_to(:double_kills) }
91
+ it { should respond_to(:first_blood_assist) }
92
+ it { should respond_to(:first_blood_kill) }
93
+ it { should respond_to(:first_inhibitor_assist) }
94
+ it { should respond_to(:first_inhibitor_kill) }
95
+ it { should respond_to(:first_tower_assist) }
96
+ it { should respond_to(:first_tower_kill) }
97
+ it { should respond_to(:gold_earned) }
98
+ it { should respond_to(:gold_spent) }
99
+ it { should respond_to(:inhibitor_kills) }
100
+ it { should respond_to(:inventory) }
101
+ it { should respond_to(:killing_sprees) }
102
+ it { should respond_to(:kills) }
103
+ it { should respond_to(:largest_crit) }
104
+ it { should respond_to(:largest_killing_spree) }
105
+ it { should respond_to(:largest_multi_kill) }
106
+ it { should respond_to(:magic_damage_dealt) }
107
+ it { should respond_to(:magic_damage_dealt_to_chanpions) }
108
+ it { should respond_to(:magic_damage_taken) }
109
+ it { should respond_to(:minions_killed) }
110
+ it { should respond_to(:neutral_minions_killed) }
111
+ it { should respond_to(:netural_minions_killed_enemy_jungle) }
112
+ it { should respond_to(:netural_minions_killed_team_jungle) }
113
+ it { should respond_to(:node_capture) }
114
+ it { should respond_to(:node_capture_assist) }
115
+ it { should respond_to(:node_neutralize) }
116
+ it { should respond_to(:objective_player_score) }
117
+ it { should respond_to(:penta_kills) }
118
+ it { should respond_to(:physical_damage_dealt) }
119
+ it { should respond_to(:physical_damage_dealt_to_champions) }
120
+ it { should respond_to(:physical_damage_taken) }
121
+ it { should respond_to(:quadra_kills) }
122
+ it { should respond_to(:sight_wards_bought) }
123
+ it { should respond_to(:team_objective) }
124
+ it { should respond_to(:total_damage_dealt) }
125
+ it { should respond_to(:total_damage_dealt_to_champions) }
126
+ it { should respond_to(:total_damage_taken) }
127
+ it { should respond_to(:total_heal) }
128
+ it { should respond_to(:total_player_score) }
129
+ it { should respond_to(:total_score_rank) }
130
+ it { should respond_to(:total_time_crowd_control_dealt) }
131
+ it { should respond_to(:total_units_healed) }
132
+ it { should respond_to(:tower_kills) }
133
+ it { should respond_to(:triple_kills) }
134
+ it { should respond_to(:true_damage_dealt) }
135
+ it { should respond_to(:true_damage_dealt_to_champions) }
136
+ it { should respond_to(:true_damage_taken) }
137
+ it { should respond_to(:unreal_kills) }
138
+ it { should respond_to(:vision_wards_bought) }
139
+ it { should respond_to(:wards_killed) }
140
+ it { should respond_to(:wards_placed) }
141
+ it { should respond_to(:winner) }
142
+
143
+ describe "should return " do
144
+ its(:assists) { should eq 6 }
145
+ its(:champ_level) { should eq 18 }
146
+ its(:combat_player_score) { should eq 0 }
147
+ its(:deaths) { should eq 6 }
148
+ its(:double_kills) { should eq 0 }
149
+ its(:first_blood_assist) { should eq false }
150
+ its(:first_blood_kill) { should eq false }
151
+ its(:first_inhibitor_assist) { should eq true }
152
+ its(:first_inhibitor_kill) { should eq false }
153
+ its(:first_tower_assist) { should eq false }
154
+ its(:first_tower_kill) { should eq false }
155
+ its(:gold_earned) { should eq 14833 }
156
+ its(:gold_spent) { should eq 14005 }
157
+ its(:inhibitor_kills) { should eq 0 }
158
+ its(:inventory) { should be_kind_of(LolApi::Inventory) }
159
+ its(:killing_sprees) { should eq 1 }
160
+ its(:kills) { should eq 6 }
161
+ its(:largest_crit) { should eq 579 }
162
+ its(:largest_killing_spree) { should eq 4 }
163
+ its(:largest_multi_kill) { should eq 1 }
164
+ its(:magic_damage_dealt) { should eq 931 }
165
+ its(:magic_damage_dealt_to_chanpions) { should eq 851 }
166
+ its(:magic_damage_taken) { should eq 5948 }
167
+ its(:minions_killed) { should eq 224 }
168
+ its(:neutral_minions_killed) { should eq 29 }
169
+ its(:netural_minions_killed_enemy_jungle) { should eq 8 }
170
+ its(:netural_minions_killed_team_jungle) { should eq 21 }
171
+ its(:node_capture) { should eq 0}
172
+ its(:node_capture_assist) { should eq 0 }
173
+ its(:node_neutralize) { should eq 0 }
174
+ its(:objective_player_score) { should eq 0 }
175
+ its(:penta_kills) { should eq 0 }
176
+ its(:physical_damage_dealt) { should eq 182899 }
177
+ its(:physical_damage_dealt_to_champions) { should eq 24291 }
178
+ its(:physical_damage_taken) { should eq 15602 }
179
+ its(:quadra_kills) { should eq 0 }
180
+ its(:sight_wards_bought) { should eq 0 }
181
+ its(:team_objective) { should eq 0 }
182
+ its(:total_damage_dealt) { should eq 184345}
183
+ its(:total_damage_dealt_to_champions) { should eq 25153 }
184
+ its(:total_damage_taken) { should eq 22233 }
185
+ its(:total_heal) { should eq 2676 }
186
+ its(:total_player_score) { should eq 0 }
187
+ its(:total_score_rank) { should eq 0 }
188
+ its(:total_time_crowd_control_dealt) { should eq 184 }
189
+ its(:total_units_healed) { should eq 2 }
190
+ its(:tower_kills) { should eq 0 }
191
+ its(:triple_kills) { should eq 0 }
192
+ its(:true_damage_dealt) { should eq 514 }
193
+ its(:true_damage_dealt_to_champions) { should eq 10 }
194
+ its(:true_damage_taken) { should eq 682 }
195
+ its(:unreal_kills) { should eq 0 }
196
+ its(:vision_wards_bought) { should eq 0 }
197
+ its(:wards_killed) { should eq 2 }
198
+ its(:wards_placed) { should eq 1 }
199
+ its(:winner) { should eq false }
200
+ end
201
+
202
+ end
203
+
204
+ describe "timelines" do
205
+ subject(:timeline) { participant.timeline }
206
+
207
+ it { should respond_to(:ancient_golem_assists) }
208
+ it { should respond_to(:ancient_golem_kills) }
209
+ it { should respond_to(:assisted_lane_deaths_delta) }
210
+ it { should respond_to(:assisted_lane_kills_delta) }
211
+ it { should respond_to(:baron_assists) }
212
+ it { should respond_to(:barron_kills) }
213
+ it { should respond_to(:creeps_delta) }
214
+ it { should respond_to(:creep_diff_delta) }
215
+ it { should respond_to(:damage_taken_diff_delta) }
216
+ it { should respond_to(:damage_take_delta) }
217
+ it { should respond_to(:dragon_assists) }
218
+ it { should respond_to(:dragon_kills) }
219
+ it { should respond_to(:elder_lizard_assists) }
220
+ it { should respond_to(:eler_lizard_kills) }
221
+ it { should respond_to(:gpm_delta) }
222
+ it { should respond_to(:inhibitor_assists) }
223
+ it { should respond_to(:inhibitor_kills) }
224
+ it { should respond_to(:lane) }
225
+ it { should respond_to(:role) }
226
+ it { should respond_to(:tower_assists) }
227
+ it { should respond_to(:tower_kills) }
228
+ it { should respond_to(:vilemaw_assists) }
229
+ it { should respond_to(:vilemaw_kills) }
230
+ it { should respond_to(:wards_delta) }
231
+ it { should respond_to(:xp_diff_delta) }
232
+ it { should respond_to(:xp_delta) }
233
+
234
+ describe "should return" do
235
+ its(:ancient_golem_assists) { should be_kind_of(LolApi::TimelineData) }
236
+ its(:ancient_golem_kills) { should be_kind_of(LolApi::TimelineData) }
237
+ its(:assisted_lane_deaths_delta) { should be_kind_of(LolApi::TimelineData) }
238
+ its(:assisted_lane_kills_delta) { should be_kind_of(LolApi::TimelineData) }
239
+ its(:baron_assists) { should be_kind_of(LolApi::TimelineData) }
240
+ its(:barron_kills) { should be_kind_of(LolApi::TimelineData) }
241
+ its(:creeps_delta) { should be_kind_of(LolApi::TimelineData) }
242
+ its(:creep_diff_delta) { should be_kind_of(LolApi::TimelineData) }
243
+ its(:damage_taken_diff_delta) { should be_kind_of(LolApi::TimelineData) }
244
+ its(:damage_take_delta) { should be_kind_of(LolApi::TimelineData) }
245
+ its(:dragon_assists) { should be_kind_of(LolApi::TimelineData) }
246
+ its(:dragon_kills) { should be_kind_of(LolApi::TimelineData) }
247
+ its(:elder_lizard_assists) { should be_kind_of(LolApi::TimelineData) }
248
+ its(:eler_lizard_kills) { should be_kind_of(LolApi::TimelineData) }
249
+ its(:gpm_delta) { should be_kind_of(LolApi::TimelineData) }
250
+ its(:inhibitor_assists) { should be_kind_of(LolApi::TimelineData) }
251
+ its(:inhibitor_kills) { should be_kind_of(LolApi::TimelineData) }
252
+ its(:lane) { should eq "BOTTOM" }
253
+ its(:role) { should eq "DUO_CARRY"}
254
+ its(:tower_assists) { should be_kind_of(LolApi::TimelineData) }
255
+ its(:tower_kills) { should be_kind_of(LolApi::TimelineData) }
256
+ its(:vilemaw_assists) { should be_kind_of(LolApi::TimelineData) }
257
+ its(:vilemaw_kills) { should be_kind_of(LolApi::TimelineData) }
258
+ its(:wards_delta) { should be_kind_of(LolApi::TimelineData) }
259
+ its(:xp_diff_delta) { should be_kind_of(LolApi::TimelineData) }
260
+ its(:xp_delta) { should be_kind_of(LolApi::TimelineData) }
261
+ end
262
+
263
+ describe 'creeps delta' do
264
+ subject { timeline.creeps_delta }
265
+
266
+ it { should respond_to(:ten_to_twenty) }
267
+ it { should respond_to(:thirty_to_end) }
268
+ it { should respond_to(:twenty_to_thirty) }
269
+ it { should respond_to(:zero_to_ten) }
270
+
271
+ describe "should return" do
272
+ its(:ten_to_twenty) { should eq 7 }
273
+ its(:thirty_to_end) { should eq 2.9 }
274
+ its(:twenty_to_thirty) { should eq 3.8 }
275
+ its(:zero_to_ten) { should eq 5.9 }
276
+ end
277
+ end
278
+ end
279
+ end
280
+ end
data/spec/item_spec.rb ADDED
@@ -0,0 +1,96 @@
1
+ require 'spec_helper'
2
+
3
+ describe LolApi::Item do
4
+ before do
5
+ @item = FactoryGirl.build(:item)
6
+ end
7
+ subject { @item }
8
+
9
+ it { should be_kind_of(LolApi::Item) }
10
+ it { should respond_to(:colloq) }
11
+ it { should respond_to(:consume_on_full) }
12
+ it { should respond_to(:consumed) }
13
+ it { should respond_to(:depth) }
14
+ it { should respond_to(:description) }
15
+ it { should respond_to(:from) }
16
+ it { should respond_to(:gold) }
17
+ it { should respond_to(:group) }
18
+ it { should respond_to(:hide_from_all) }
19
+ it { should respond_to(:id) }
20
+ it { should respond_to(:image) }
21
+ it { should respond_to(:in_store) }
22
+ it { should respond_to(:into) }
23
+ it { should respond_to(:maps) }
24
+ it { should respond_to(:name) }
25
+ it { should respond_to(:plain_text) }
26
+ it { should respond_to(:required_champion) }
27
+ it { should respond_to(:rune) }
28
+ it { should respond_to(:sanitized_description) }
29
+ it { should respond_to(:special_recipe) }
30
+ it { should respond_to(:stacks) }
31
+ it { should respond_to(:stats) }
32
+ it { should respond_to(:tags) }
33
+
34
+ describe "should return" do
35
+ its(:colloq) { should eq "spooky ghosts" }
36
+ its(:consume_on_full) { should eq false }
37
+ its(:consumed) { should eq false }
38
+ its(:depth) { should eq 3 }
39
+ its(:description) { should include("<stats>+80 Ability Power<br>+10%") }
40
+ its(:from) { should include("3108") }
41
+ its(:gold) { should be_kind_of(LolApi::Gold)}
42
+ its(:group) { should eq "item" }
43
+ its(:hide_from_all) { should eq false }
44
+ its(:id) { should eq 3290 }
45
+ its(:image) { should be_kind_of(LolApi::Image) }
46
+ its(:in_store) { should eq false }
47
+ its(:into) { should include("3046") }
48
+ its(:maps) { should have_key("1") }
49
+ its(:name) { should eq "Twin Shadows" }
50
+ its(:plain_text) { should include("Summon wraiths to slow and") }
51
+ its(:required_champion) { should eq "Rengar" }
52
+ its(:rune) { should have_key("isRune") }
53
+ its(:sanitized_description) { should include("+80 Ability Power +10% Cooldown Reduction") }
54
+ its(:special_recipe) { should eq 3169 }
55
+ its(:stacks) { should eq 3 }
56
+ its(:stats) { should have_key("FlatMagicDamageMod") }
57
+ its(:tags) { should include("SpellDamage") }
58
+ end
59
+
60
+ describe 'gold' do
61
+ subject { @item.gold }
62
+
63
+ it { should respond_to(:base) }
64
+ it { should respond_to(:purchasable) }
65
+ it { should respond_to(:sell) }
66
+ it { should respond_to(:total) }
67
+
68
+ describe "should return" do
69
+ its(:base) { should eq 630 }
70
+ its(:purchasable) { should eq true }
71
+ its(:sell) { should eq 1680 }
72
+ its(:total) { should eq 2400 }
73
+ end
74
+ end
75
+
76
+ describe 'image' do
77
+ subject { @item.image }
78
+ it { should respond_to(:full) }
79
+ it { should respond_to(:group) }
80
+ it { should respond_to(:height) }
81
+ it { should respond_to(:sprite) }
82
+ it { should respond_to(:width) }
83
+ it { should respond_to(:x) }
84
+ it { should respond_to(:y) }
85
+
86
+ describe "should return" do
87
+ its(:full) { should eq '3290.png' }
88
+ its(:group) { should eq 'item' }
89
+ its(:height) { should eq 48 }
90
+ its(:sprite) { should eq 'item2.png' }
91
+ its(:width) { should eq 48 }
92
+ its(:x) { should eq 144 }
93
+ its(:y) { should eq 0 }
94
+ end
95
+ end
96
+ end
@@ -0,0 +1,27 @@
1
+ require 'spec_helper'
2
+
3
+ describe LolApi::Mastery do
4
+ before do
5
+ @mastery = FactoryGirl.build(:mastery)
6
+ end
7
+ subject { @mastery }
8
+
9
+ it { should be_kind_of(LolApi::Mastery) }
10
+ it { should respond_to(:description) }
11
+ it { should respond_to(:id) }
12
+ it { should respond_to(:image) }
13
+ it { should respond_to(:name) }
14
+ it { should respond_to(:prereq) }
15
+ it { should respond_to(:ranks) }
16
+ it { should respond_to(:sanitized_description) }
17
+
18
+ describe "should return" do
19
+ its(:description) { should include("+2% Cooldown Reduction and reduces the cooldown of Activated Items by 4%") }
20
+ its(:id) { should eq 4353 }
21
+ its(:image) { should be_kind_of(LolApi::Image) }
22
+ its(:name) { should eq "Intelligence" }
23
+ its(:prereq) { should eq 0 }
24
+ its(:ranks) { should eq 3 }
25
+ its(:sanitized_description) { should include("+2% Cooldown Reduction and reduces the cooldown of Activated Items by 4%")}
26
+ end
27
+ end