test now wait 1 sec and retry if ratelimit is exceeded

This commit is contained in:
danijoo
2014-01-01 18:21:12 +01:00
parent faa4783801
commit 244c94836f
5 changed files with 77 additions and 20 deletions

View File

@@ -5,10 +5,14 @@ require 'sightstone'
class GameModuleTest < BaseTest
@@req_id = 30447079
def test_recent_games
matchHistory = @@sightstone.game.recent(@@req_id)
begin
matchHistory = @@sightstone.game.recent(@@req_id)
rescue Sightstone::RateLimitExceededException
puts "Rate limit exeeded, waiting 1 sec"
sleep 1
retry
end
assert_instance_of(MatchHistory, matchHistory)
assert_instance_of(Fixnum, matchHistory.summonerId)
assert_instance_of(Array, matchHistory.games)