some name changes and fixed tests
This commit is contained in:
@@ -13,7 +13,7 @@ class LeagueModule < SightstoneBaseModule
|
|||||||
# @param [Summoner, Integer] summoner
|
# @param [Summoner, Integer] summoner
|
||||||
# @param optional [Hash] optional arguments: :region => replaces default region
|
# @param optional [Hash] optional arguments: :region => replaces default region
|
||||||
# @return [Array<League>] an array of all leagues the summoner and his teams are in
|
# @return [Array<League>] an array of all leagues the summoner and his teams are in
|
||||||
def league(summoner, optional={})
|
def leagues(summoner, optional={})
|
||||||
region = optional[:region] || @sightstone.region
|
region = optional[:region] || @sightstone.region
|
||||||
id = if summoner.is_a? Summoner
|
id = if summoner.is_a? Summoner
|
||||||
summoner.id
|
summoner.id
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ class SummonerModule < SightstoneBaseModule
|
|||||||
# @param summoner [Summoner, id] summoner object or id of a summoner
|
# @param summoner [Summoner, id] summoner object or id of a summoner
|
||||||
# @param optional [Hash<Symbol, String>] optional arguments: :region => replaces default region
|
# @param optional [Hash<Symbol, String>] optional arguments: :region => replaces default region
|
||||||
# @return [Runebook] runebook of the summoner
|
# @return [Runebook] runebook of the summoner
|
||||||
def runes(summoner, optional={})
|
def runebook(summoner, optional={})
|
||||||
region = optional[:region] || @sightstone.region
|
region = optional[:region] || @sightstone.region
|
||||||
id = if summoner.is_a? Summoner
|
id = if summoner.is_a? Summoner
|
||||||
summoner.id
|
summoner.id
|
||||||
@@ -88,7 +88,7 @@ class SummonerModule < SightstoneBaseModule
|
|||||||
# @param summoner [Summoner, id] summoner object or id of a summoner
|
# @param summoner [Summoner, id] summoner object or id of a summoner
|
||||||
# @param optional [Hash<Symbol, String>] optional arguments: :region => replaces default region
|
# @param optional [Hash<Symbol, String>] optional arguments: :region => replaces default region
|
||||||
# @return [Masterybook] masterybook of the summoner
|
# @return [Masterybook] masterybook of the summoner
|
||||||
def masteries(summoner, optional={})
|
def masterybook(summoner, optional={})
|
||||||
region = optional[:region] || @sightstone.region
|
region = optional[:region] || @sightstone.region
|
||||||
id = if summoner.is_a? Summoner
|
id = if summoner.is_a? Summoner
|
||||||
summoner.id
|
summoner.id
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ require 'sightstone'
|
|||||||
|
|
||||||
class BaseTest < Test::Unit::TestCase
|
class BaseTest < Test::Unit::TestCase
|
||||||
|
|
||||||
@@sightstone = Sightstone.new("your_api_key_here")
|
@@sightstone = Sightstone::Sightstone.new("your_test_api_key")
|
||||||
|
|
||||||
@@req_id = 30447079
|
@@req_id = 30447079
|
||||||
@@test_id_array = [30447079,30447079,30447079]
|
@@test_id_array = [30447079,30447079,30447079]
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class LeagueModuleTest < BaseTest
|
|||||||
|
|
||||||
def test_league
|
def test_league
|
||||||
begin
|
begin
|
||||||
leagues = @@sightstone.league.league(@@req_id)
|
leagues = @@sightstone.league.leagues(@@req_id)
|
||||||
rescue Sightstone::RateLimitExceededException
|
rescue Sightstone::RateLimitExceededException
|
||||||
puts "Rate limit exeeded, waiting 1 sec"
|
puts "Rate limit exeeded, waiting 1 sec"
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class SummonerModuleTest < BaseTest
|
|||||||
|
|
||||||
def test_summoner_runebook
|
def test_summoner_runebook
|
||||||
begin
|
begin
|
||||||
runebook = @@sightstone.summoner.runes(@@test_id_array[0])
|
runebook = @@sightstone.summoner.runebook(@@test_id_array[0])
|
||||||
rescue Sightstone::RateLimitExceededException
|
rescue Sightstone::RateLimitExceededException
|
||||||
puts "Rate limit exeeded, waiting 1 sec"
|
puts "Rate limit exeeded, waiting 1 sec"
|
||||||
sleep 1
|
sleep 1
|
||||||
@@ -85,7 +85,7 @@ class SummonerModuleTest < BaseTest
|
|||||||
|
|
||||||
def test_summoner_masterybook
|
def test_summoner_masterybook
|
||||||
begin
|
begin
|
||||||
masterybook = @@sightstone.summoner.masteries(@@test_id_array[0])
|
masterybook = @@sightstone.summoner.masterybook(@@test_id_array[0])
|
||||||
rescue Sightstone::RateLimitExceededException
|
rescue Sightstone::RateLimitExceededException
|
||||||
puts "Rate limit exeeded, waiting 1 sec"
|
puts "Rate limit exeeded, waiting 1 sec"
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|||||||
Reference in New Issue
Block a user