Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
Francis
Blizzard api
Commits
84eb83c2
Commit
84eb83c2
authored
Apr 10, 2020
by
Francis
Browse files
Region manipulation improvements
parent
5b10d77b
Pipeline
#134877770
passed with stage
in 5 minutes and 39 seconds
Changes
53
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
53 changed files
with
304 additions
and
248 deletions
+304
-248
CHANGELOG.md
CHANGELOG.md
+5
-0
Gemfile.lock
Gemfile.lock
+1
-1
lib/blizzard_api/diablo.rb
lib/blizzard_api/diablo.rb
+27
-18
lib/blizzard_api/hearthstone.rb
lib/blizzard_api/hearthstone.rb
+12
-8
lib/blizzard_api/request.rb
lib/blizzard_api/request.rb
+0
-1
lib/blizzard_api/starcraft.rb
lib/blizzard_api/starcraft.rb
+12
-8
lib/blizzard_api/version.rb
lib/blizzard_api/version.rb
+1
-1
lib/blizzard_api/wow.rb
lib/blizzard_api/wow.rb
+96
-96
test/blizzard/diablo/community/act_test.rb
test/blizzard/diablo/community/act_test.rb
+6
-4
test/blizzard/diablo/community/artisan_test.rb
test/blizzard/diablo/community/artisan_test.rb
+6
-4
test/blizzard/diablo/community/character_test.rb
test/blizzard/diablo/community/character_test.rb
+6
-4
test/blizzard/diablo/community/follower_test.rb
test/blizzard/diablo/community/follower_test.rb
+5
-2
test/blizzard/diablo/community/item_test.rb
test/blizzard/diablo/community/item_test.rb
+5
-2
test/blizzard/diablo/community/item_type_test.rb
test/blizzard/diablo/community/item_type_test.rb
+6
-4
test/blizzard/diablo/game_data/era_test.rb
test/blizzard/diablo/game_data/era_test.rb
+7
-6
test/blizzard/diablo/game_data/season_test.rb
test/blizzard/diablo/game_data/season_test.rb
+7
-6
test/blizzard/hearthstone/game_data/back_test.rb
test/blizzard/hearthstone/game_data/back_test.rb
+6
-4
test/blizzard/hearthstone/game_data/card_test.rb
test/blizzard/hearthstone/game_data/card_test.rb
+7
-6
test/blizzard/hearthstone/game_data/deck_test.rb
test/blizzard/hearthstone/game_data/deck_test.rb
+5
-2
test/blizzard/hearthstone/game_data/metadata_test.rb
test/blizzard/hearthstone/game_data/metadata_test.rb
+6
-4
test/blizzard/starcraft/community/ladder_test.rb
test/blizzard/starcraft/community/ladder_test.rb
+6
-4
test/blizzard/starcraft/community/profile_test.rb
test/blizzard/starcraft/community/profile_test.rb
+5
-2
test/blizzard/starcraft/game_data/league_test.rb
test/blizzard/starcraft/game_data/league_test.rb
+5
-2
test/blizzard/wow/game_data/achievement_test.rb
test/blizzard/wow/game_data/achievement_test.rb
+10
-12
test/blizzard/wow/game_data/auction_test.rb
test/blizzard/wow/game_data/auction_test.rb
+1
-1
test/blizzard/wow/game_data/azerite_essence_test.rb
test/blizzard/wow/game_data/azerite_essence_test.rb
+1
-1
test/blizzard/wow/game_data/connected_realm_test.rb
test/blizzard/wow/game_data/connected_realm_test.rb
+7
-6
test/blizzard/wow/game_data/creature_test.rb
test/blizzard/wow/game_data/creature_test.rb
+1
-1
test/blizzard/wow/game_data/guild_crest_test.rb
test/blizzard/wow/game_data/guild_crest_test.rb
+1
-1
test/blizzard/wow/game_data/item_test.rb
test/blizzard/wow/game_data/item_test.rb
+1
-1
test/blizzard/wow/game_data/journal_test.rb
test/blizzard/wow/game_data/journal_test.rb
+1
-1
test/blizzard/wow/game_data/mount_test.rb
test/blizzard/wow/game_data/mount_test.rb
+1
-1
test/blizzard/wow/game_data/mythic_keystone_affix_test.rb
test/blizzard/wow/game_data/mythic_keystone_affix_test.rb
+1
-1
test/blizzard/wow/game_data/mythic_keystone_leaderboard_test.rb
...lizzard/wow/game_data/mythic_keystone_leaderboard_test.rb
+1
-1
test/blizzard/wow/game_data/mythic_keystone_test.rb
test/blizzard/wow/game_data/mythic_keystone_test.rb
+8
-8
test/blizzard/wow/game_data/mythic_raid_leaderboard_test.rb
test/blizzard/wow/game_data/mythic_raid_leaderboard_test.rb
+5
-2
test/blizzard/wow/game_data/pets_test.rb
test/blizzard/wow/game_data/pets_test.rb
+1
-1
test/blizzard/wow/game_data/playable_class_test.rb
test/blizzard/wow/game_data/playable_class_test.rb
+1
-1
test/blizzard/wow/game_data/playable_race_test.rb
test/blizzard/wow/game_data/playable_race_test.rb
+1
-1
test/blizzard/wow/game_data/playable_specialization_test.rb
test/blizzard/wow/game_data/playable_specialization_test.rb
+1
-1
test/blizzard/wow/game_data/power_type_test.rb
test/blizzard/wow/game_data/power_type_test.rb
+7
-6
test/blizzard/wow/game_data/pvp_season_test.rb
test/blizzard/wow/game_data/pvp_season_test.rb
+1
-1
test/blizzard/wow/game_data/pvp_tier_test.rb
test/blizzard/wow/game_data/pvp_tier_test.rb
+1
-1
test/blizzard/wow/game_data/quest_test.rb
test/blizzard/wow/game_data/quest_test.rb
+1
-1
test/blizzard/wow/game_data/realm_test.rb
test/blizzard/wow/game_data/realm_test.rb
+1
-1
test/blizzard/wow/game_data/region_test.rb
test/blizzard/wow/game_data/region_test.rb
+1
-1
test/blizzard/wow/game_data/reputation_test.rb
test/blizzard/wow/game_data/reputation_test.rb
+1
-1
test/blizzard/wow/game_data/spell_test.rb
test/blizzard/wow/game_data/spell_test.rb
+1
-1
test/blizzard/wow/game_data/talent_test.rb
test/blizzard/wow/game_data/talent_test.rb
+1
-1
test/blizzard/wow/game_data/title_test.rb
test/blizzard/wow/game_data/title_test.rb
+1
-1
test/blizzard/wow/game_data/wow_token_test.rb
test/blizzard/wow/game_data/wow_token_test.rb
+1
-1
test/blizzard/wow/profile/character_test.rb
test/blizzard/wow/profile/character_test.rb
+1
-1
test/blizzard/wow/profile/guild_test.rb
test/blizzard/wow/profile/guild_test.rb
+1
-1
No files found.
CHANGELOG.md
View file @
84eb83c2
Please view this file on the master branch, otherwise it may be outdated
**Version 0.3.7**
Automated test improvements
Added region parameters to all game module methods. This will allow multi-region applications to have more flexibility when creating instances.
**Version 0.3.6**
Fix Diablo shortcuts.
...
...
Gemfile.lock
View file @
84eb83c2
PATH
remote: .
specs:
blizzard_api (0.3.
6
)
blizzard_api (0.3.
7
)
redis (~> 4.1, >= 4.1.0)
GEM
...
...
lib/blizzard_api/diablo.rb
View file @
84eb83c2
...
...
@@ -11,15 +11,17 @@ module BlizzardApi
require_relative
'diablo/game_data/era'
##
# @param region [String] API Region
# @return {Season}
def
self
.
season
BlizzardApi
::
Diablo
::
Season
.
new
def
self
.
season
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Diablo
::
Season
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {Era}
def
self
.
era
BlizzardApi
::
Diablo
::
Era
.
new
def
self
.
era
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Diablo
::
Era
.
new
(
region
)
end
# Diablo community api
...
...
@@ -32,45 +34,52 @@ module BlizzardApi
require_relative
'diablo/community/profile'
##
# @param region [String] API Region
# @return {Act}
def
self
.
act
BlizzardApi
::
Diablo
::
Act
.
new
def
self
.
act
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Diablo
::
Act
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {Artisan}
def
self
.
artisan
BlizzardApi
::
Diablo
::
Artisan
.
new
def
self
.
artisan
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Diablo
::
Artisan
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {Follower}
def
self
.
follower
BlizzardApi
::
Diablo
::
Follower
.
new
def
self
.
follower
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Diablo
::
Follower
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {Character}
def
self
.
character
BlizzardApi
::
Diablo
::
Character
.
new
def
self
.
character
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Diablo
::
Character
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {ItemType}
def
self
.
item_type
BlizzardApi
::
Diablo
::
ItemType
.
new
def
self
.
item_type
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Diablo
::
ItemType
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {Type}
def
self
.
item
BlizzardApi
::
Diablo
::
Item
.
new
def
self
.
item
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Diablo
::
Item
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {Profile}
def
self
.
profile
BlizzardApi
::
Diablo
::
Profile
.
new
def
self
.
profile
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Diablo
::
Profile
.
new
(
region
)
end
end
end
lib/blizzard_api/hearthstone.rb
View file @
84eb83c2
...
...
@@ -13,27 +13,31 @@ module BlizzardApi
require_relative
'hearthstone/game_data/metadata'
##
# @param region [String] API Region
# @return {Card}
def
self
.
card
BlizzardApi
::
Hearthstone
::
Card
.
new
def
self
.
card
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Hearthstone
::
Card
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {Back}
def
self
.
back
BlizzardApi
::
Hearthstone
::
Back
.
new
def
self
.
back
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Hearthstone
::
Back
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {Deck}
def
self
.
deck
BlizzardApi
::
Hearthstone
::
Deck
.
new
def
self
.
deck
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Hearthstone
::
Deck
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {Metadata}
def
self
.
metadata
BlizzardApi
::
Hearthstone
::
Metadata
.
new
def
self
.
metadata
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Hearthstone
::
Metadata
.
new
(
region
)
end
end
end
lib/blizzard_api/request.rb
View file @
84eb83c2
...
...
@@ -3,7 +3,6 @@
##
# @!macro [new] request_options
# @param {Hash} options You can specify some options
# @option options [String] :region Overrides the default region for a single call
# @option options [String] :locale Overrides the default locale for a single call
# @option options [String] :namespace Overrides the default namespace for a single call
# @option options [String] :access_token Overrides the access_token for a single call
...
...
lib/blizzard_api/starcraft.rb
View file @
84eb83c2
...
...
@@ -9,9 +9,10 @@ module BlizzardApi
require_relative
'starcraft/game_data/league'
##
# @param region [String] API Region
# @return {League}
def
self
.
league
BlizzardApi
::
Starcraft
::
League
.
new
def
self
.
league
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Starcraft
::
League
.
new
(
region
)
end
# Starcraft community api
...
...
@@ -20,21 +21,24 @@ module BlizzardApi
require_relative
'starcraft/community/account'
##
# @param region [String] API Region
# @return {Profile}
def
self
.
profile
BlizzardApi
::
Starcraft
::
Profile
.
new
def
self
.
profile
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Starcraft
::
Profile
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {Ladder}
def
self
.
ladder
BlizzardApi
::
Starcraft
::
Ladder
.
new
def
self
.
ladder
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Starcraft
::
Ladder
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {Account}
def
self
.
account
BlizzardApi
::
Starcraft
::
Account
.
new
def
self
.
account
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Starcraft
::
Account
.
new
(
region
)
end
end
end
lib/blizzard_api/version.rb
View file @
84eb83c2
...
...
@@ -2,5 +2,5 @@
module
BlizzardApi
# Gem version
VERSION
=
'0.3.
6
'
VERSION
=
'0.3.
7
'
end
lib/blizzard_api/wow.rb
View file @
84eb83c2
...
...
@@ -37,207 +37,206 @@ module BlizzardApi
require_relative
'wow/game_data/wow_token'
##
# @param region [String] API Region
# @return {Achievement}
def
self
.
achievement
BlizzardApi
::
Wow
::
Achievement
.
new
def
self
.
achievement
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
Achievement
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {Auction}
def
self
.
auction
BlizzardApi
::
Wow
::
Auction
.
new
def
self
.
auction
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
Auction
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {AzeriteEssence}
def
self
.
azerite_essence
BlizzardApi
::
Wow
::
AzeriteEssence
.
new
def
self
.
azerite_essence
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
AzeriteEssence
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {ConnectedRealm}
def
self
.
connected_realm
BlizzardApi
::
Wow
::
ConnectedRealm
.
new
def
self
.
connected_realm
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
ConnectedRealm
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {Creature}
def
self
.
creature
BlizzardApi
::
Wow
::
Creature
.
new
def
self
.
creature
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
Creature
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {GuildCrest}
def
self
.
guild_crest
BlizzardApi
::
Wow
::
GuildCrest
.
new
def
self
.
guild_crest
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
GuildCrest
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {Item}
def
self
.
item
BlizzardApi
::
Wow
::
Item
.
new
def
self
.
item
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
Item
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {Journal}
def
self
.
journal
BlizzardApi
::
Wow
::
Journal
.
new
def
self
.
journal
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
Journal
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {Mount}
def
self
.
mount
BlizzardApi
::
Wow
::
Mount
.
new
def
self
.
mount
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
Mount
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {MythicKeystoneAffix}
def
self
.
mythic_keystone_affix
BlizzardApi
::
Wow
::
MythicKeystoneAffix
.
new
def
self
.
mythic_keystone_affix
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
MythicKeystoneAffix
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {MythicKeystone}
def
self
.
mythic_keystone
BlizzardApi
::
Wow
::
MythicKeystone
.
new
def
self
.
mythic_keystone
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
MythicKeystone
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {MythicRaidLeaderboard}
def
self
.
mythic_raid_leaderboard
BlizzardApi
::
Wow
::
MythicRaidLeaderboard
.
new
def
self
.
mythic_raid_leaderboard
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
MythicRaidLeaderboard
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {MythicKeystoneLeaderboard}
def
self
.
mythic_keystone_leaderboard
BlizzardApi
::
Wow
::
MythicKeystoneLeaderboard
.
new
def
self
.
mythic_keystone_leaderboard
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
MythicKeystoneLeaderboard
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {Pet}
def
self
.
pet
BlizzardApi
::
Wow
::
Pet
.
new
def
self
.
pet
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
Pet
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {PlayableClass}
def
self
.
playable_class
BlizzardApi
::
Wow
::
PlayableClass
.
new
def
self
.
playable_class
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
PlayableClass
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {Race}
def
self
.
playable_race
BlizzardApi
::
Wow
::
PlayableRace
.
new
def
self
.
playable_race
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
PlayableRace
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {PlayableSpecialization}
def
self
.
playable_specialization
BlizzardApi
::
Wow
::
PlayableSpecialization
.
new
def
self
.
playable_specialization
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
PlayableSpecialization
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {PowerType}
def
self
.
power_type
BlizzardApi
::
Wow
::
PowerType
.
new
def
self
.
power_type
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
PowerType
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {PvpSeason}
def
self
.
pvp_season
BlizzardApi
::
Wow
::
PvpSeason
.
new
def
self
.
pvp_season
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
PvpSeason
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {PvpTier}
def
self
.
pvp_tier
BlizzardApi
::
Wow
::
PvpTier
.
new
def
self
.
pvp_tier
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
PvpTier
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {Quest}
def
self
.
quest
BlizzardApi
::
Wow
::
Quest
.
new
def
self
.
quest
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
Quest
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {Realm}
def
self
.
realm
BlizzardApi
::
Wow
::
Realm
.
new
def
self
.
realm
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
Realm
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {Region}
def
self
.
region
BlizzardApi
::
Wow
::
Region
.
new
def
self
.
region
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
Region
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {Reputation}
def
self
.
reputation
BlizzardApi
::
Wow
::
Reputation
.
new
def
self
.
reputation
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
Reputation
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {Spell}
def
self
.
spell
BlizzardApi
::
Wow
::
Spell
.
new
def
self
.
spell
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
Spell
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {Talent}
def
self
.
talent
BlizzardApi
::
Wow
::
Talent
.
new
def
self
.
talent
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
Talent
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {Title}
def
self
.
title
BlizzardApi
::
Wow
::
Title
.
new
def
self
.
title
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
Title
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {WowToken}
def
self
.
wow_token
BlizzardApi
::
Wow
::
WowToken
.
new
end
##
# @return {Boss}
def
self
.
boss
BlizzardApi
::
Wow
::
Boss
.
new
end
##
# @return {Challenge}
def
self
.
challenge
BlizzardApi
::
Wow
::
Challenge
.
new
def
self
.
wow_token
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
WowToken
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {Character}
def
self
.
character
BlizzardApi
::
Wow
::
Character
.
new
end
##
# @return {PvP}
def
self
.
pvp
BlizzardApi
::
Wow
::
PvP
.
new
end
##
# @return {Recipe}
def
self
.
recipe
BlizzardApi
::
Wow
::
Recipe
.
new
end
##
# @return {Zone}
def
self
.
zone
BlizzardApi
::
Wow
::
Zone
.
new
def
self
.
character
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
Character
.
new
(
region
)
end
require_relative
'wow/profile/profile'
...
...
@@ -246,24 +245,25 @@ module BlizzardApi
##
# @param token [String] A token obtained using the authorization_code flow
#
# @!macro request_options
# @param region [String] API Region
#
# @return {Profile}
def
self
.
profile
(
token
)
BlizzardApi
::
Wow
::
AccountProfile
.
new
(
token
)
def
self
.
profile
(
token
,
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
AccountProfile
.
new
(
token
,
region
)
end
##
# @param region [String] API Region
# @return {Guild}
def
self
.
guild
BlizzardApi
::
Wow
::
Guild
.
new
def
self
.
guild
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
Guild
.
new
(
region
)
end
##
# @param region [String] API Region
# @return {CharacterProfile}
def
self
.
character_profile
BlizzardApi
::
Wow
::
CharacterProfile
.
new
def
self
.
character_profile
(
region
=
BlizzardApi
.
region
)
BlizzardApi
::
Wow
::
CharacterProfile
.
new
(
region
)
end
end
end
test/blizzard/diablo/community/act_test.rb
View file @
84eb83c2
...
...
@@ -7,15 +7,17 @@ require 'test_helper'
module
BlizzardApi
module
Diablo
class
ActTest
<
Minitest
::
Test
def
setup
@act
=
BlizzardApi
::
Diablo
.
act
end
def
test_act_index
act
=
BlizzardApi
::
Diablo
::
Act
.
new
act_data
=
act
.
index
act_data
=
@act
.
index
assert
act_data
[
:acts
]
end
def
test_act_get
act
=
BlizzardApi
::
Diablo
::
Act
.
new
act_data
=
act
.
get
1
act_data
=
@act
.
get
1
assert
act_data
[
:quests
]
end
end
...
...
test/blizzard/diablo/community/artisan_test.rb
View file @
84eb83c2
...
...
@@ -7,15 +7,17 @@ require 'test_helper'
module
BlizzardApi
module
Diablo
class
ArtisanTest
<
Minitest
::
Test
def
setup
@artisan
=
BlizzardApi
::
Diablo
.
artisan
end
def
test_artisan_index
artisan
=
BlizzardApi
::
Diablo
::
Artisan
.
new
artisan_data
=
artisan
.
get
'blacksmith'
artisan_data
=
@artisan
.
get
'blacksmith'
assert
artisan_data
[
:training
]
end
def
test_artisan_get