Skip to content

Commit

Permalink
Update API endpoint, tests
Browse files Browse the repository at this point in the history
  • Loading branch information
picandocodigo committed Feb 16, 2020
1 parent 0f176ab commit 3a7b028
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
7 changes: 4 additions & 3 deletions lib/thegamesdb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@

# Client for TheGamesDB API (thegamesdb.net)
module Gamesdb
BASE_URL = 'https://api.thegamesdb.net/'.freeze
BASE_URL = 'https://api.thegamesdb.net/v1/'.freeze
IMAGES_BASE_URL = 'https://legacy.thegamesdb.net/banners/'.freeze

# Method for listing platform's games
# https://api.thegamesdb.net/#/operations/Games/GamesByPlatformID
#
# See: https://api.thegamesdb.net/#/operations/Games/GamesByPlatformID
#
# Parameters: platform id (int), page (int)
#
# == Returns:
# = Returns:
# Array of Hashes with games info
#
def self.games_by_platform_id(platform_id, page = 1)
Expand Down
3 changes: 1 addition & 2 deletions test/games_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@
end

it 'should return an empty array' do
@images.must_be_kind_of Array
@images.must_equal []
@images.must_be_kind_of Hash
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/platform_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

it 'should get gaming platforms' do
@platforms.count.wont_be :<, 0
@platforms.count.must_equal 109
@platforms.count.must_equal 110
end

it 'should have a valid name' do
Expand Down

0 comments on commit 3a7b028

Please sign in to comment.