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