nba_stats 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +22 -0
- data/.idea/.name +1 -0
- data/.idea/.rakeTasks +7 -0
- data/.idea/encodings.xml +5 -0
- data/.idea/misc.xml +21 -0
- data/.idea/modules.xml +9 -0
- data/.idea/nba_stats.iml +43 -0
- data/.idea/scopes/scope_settings.xml +5 -0
- data/.idea/vcs.xml +7 -0
- data/.idea/workspace.xml +782 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +68 -0
- data/Rakefile +45 -0
- data/lib/nba_stats/client.rb +135 -0
- data/lib/nba_stats/configuration.rb +37 -0
- data/lib/nba_stats/constants.rb +96 -0
- data/lib/nba_stats/discovery/discovery.rb +193 -0
- data/lib/nba_stats/errors.rb +9 -0
- data/lib/nba_stats/helper.rb +10 -0
- data/lib/nba_stats/resources/box_score.rb +35 -0
- data/lib/nba_stats/resources/box_score_advanced.rb +38 -0
- data/lib/nba_stats/resources/box_score_four_factors.rb +38 -0
- data/lib/nba_stats/resources/box_score_misc.rb +38 -0
- data/lib/nba_stats/resources/box_score_scoring.rb +38 -0
- data/lib/nba_stats/resources/box_score_usage.rb +38 -0
- data/lib/nba_stats/resources/common_all_players.rb +23 -0
- data/lib/nba_stats/resources/common_player_info.rb +24 -0
- data/lib/nba_stats/resources/common_team_roster.rb +24 -0
- data/lib/nba_stats/resources/common_team_years.rb +24 -0
- data/lib/nba_stats/resources/draft_combine_drill_results.rb +24 -0
- data/lib/nba_stats/resources/draft_combine_non_stationary_shooting.rb +24 -0
- data/lib/nba_stats/resources/draft_combine_player_anthro.rb +24 -0
- data/lib/nba_stats/resources/draft_combine_spot_shooting.rb +24 -0
- data/lib/nba_stats/resources/draft_combine_stats.rb +24 -0
- data/lib/nba_stats/resources/franchise_history.rb +25 -0
- data/lib/nba_stats/resources/home_page_leaders.rb +26 -0
- data/lib/nba_stats/resources/league_dash_lineups.rb +24 -0
- data/lib/nba_stats/resources/league_dash_player_stats.rb +24 -0
- data/lib/nba_stats/resources/play_by_play.rb +25 -0
- data/lib/nba_stats/resources/player_career_stats.rb +29 -0
- data/lib/nba_stats/resources/player_profile.rb +31 -0
- data/lib/nba_stats/resources/resource_base.rb +86 -0
- data/lib/nba_stats/resources/scoreboard.rb +29 -0
- data/lib/nba_stats/resources/shot_chart_detail.rb +25 -0
- data/lib/nba_stats/resources/team_game_log.rb +23 -0
- data/lib/nba_stats/resources/team_info_common.rb +24 -0
- data/lib/nba_stats/resources/team_year_by_year_stats.rb +24 -0
- data/lib/nba_stats/stats/box_score.rb +42 -0
- data/lib/nba_stats/stats/box_score_advanced.rb +41 -0
- data/lib/nba_stats/stats/box_score_four_factors.rb +41 -0
- data/lib/nba_stats/stats/box_score_misc.rb +41 -0
- data/lib/nba_stats/stats/box_score_scoring.rb +41 -0
- data/lib/nba_stats/stats/box_score_usage.rb +41 -0
- data/lib/nba_stats/stats/common_all_players.rb +33 -0
- data/lib/nba_stats/stats/common_player_info.rb +33 -0
- data/lib/nba_stats/stats/common_team_roster.rb +33 -0
- data/lib/nba_stats/stats/common_team_years.rb +26 -0
- data/lib/nba_stats/stats/draft_combine_drill_results.rb +29 -0
- data/lib/nba_stats/stats/draft_combine_non_stationary_shooting.rb +29 -0
- data/lib/nba_stats/stats/draft_combine_player_anthro.rb +29 -0
- data/lib/nba_stats/stats/draft_combine_spot_shooting.rb +29 -0
- data/lib/nba_stats/stats/draft_combine_stats.rb +29 -0
- data/lib/nba_stats/stats/franchise_history.rb +26 -0
- data/lib/nba_stats/stats/home_page_leaders.rb +44 -0
- data/lib/nba_stats/stats/league_dash_lineups.rb +107 -0
- data/lib/nba_stats/stats/league_dash_player_stats.rb +104 -0
- data/lib/nba_stats/stats/play_by_play.rb +32 -0
- data/lib/nba_stats/stats/player_career_stats.rb +32 -0
- data/lib/nba_stats/stats/player_profile.rb +45 -0
- data/lib/nba_stats/stats/scoreboard.rb +33 -0
- data/lib/nba_stats/stats/shot_chart_detail.rb +95 -0
- data/lib/nba_stats/stats/team_game_log.rb +36 -0
- data/lib/nba_stats/stats/team_info_common.rb +36 -0
- data/lib/nba_stats/stats/team_year_by_year_stats.rb +38 -0
- data/lib/nba_stats/version.rb +3 -0
- data/lib/nba_stats.rb +8 -0
- data/nba_stats.gemspec +28 -0
- data/spec/client/box_score_advanced_spec.rb +30 -0
- data/spec/client/box_score_four_factors_spec.rb +30 -0
- data/spec/client/box_score_misc_spec.rb +30 -0
- data/spec/client/box_score_scoring_spec.rb +30 -0
- data/spec/client/box_score_spec.rb +30 -0
- data/spec/client/box_score_usage_spec.rb +30 -0
- data/spec/client/common_all_players_spec.rb +27 -0
- data/spec/client/common_player_info_spec.rb +33 -0
- data/spec/client/common_team_roster_spec.rb +27 -0
- data/spec/client/common_team_years_spec.rb +27 -0
- data/spec/client/draft_combine_drill_results_spec.rb +27 -0
- data/spec/client/draft_combine_non_stationary_shooting_spec.rb +27 -0
- data/spec/client/draft_combine_player_anthro_spec.rb +27 -0
- data/spec/client/draft_combine_spot_shooting_spec.rb +27 -0
- data/spec/client/draft_combine_stats_spec.rb +27 -0
- data/spec/client/franchise_history_spec.rb +30 -0
- data/spec/client/home_page_leaders_spec.rb +27 -0
- data/spec/client/league_dash_lineups_spec.rb +27 -0
- data/spec/client/league_dash_player_stats_spec.rb +27 -0
- data/spec/client/play_by_play_spec.rb +30 -0
- data/spec/client/player_career_stats_spec.rb +30 -0
- data/spec/client/player_profile_spec.rb +30 -0
- data/spec/client/scoreboard_spec.rb +30 -0
- data/spec/client/shot_chart_detail_spec.rb +27 -0
- data/spec/client/team_game_log_spec.rb +27 -0
- data/spec/client/team_info_common_spec.rb +30 -0
- data/spec/client/team_year_by_year_stats_spec.rb +30 -0
- data/spec/client_spec.rb +17 -0
- data/spec/configuration_spec.rb +38 -0
- data/spec/nba_stats_spec.rb +13 -0
- data/spec/spec_helper.rb +21 -0
- metadata +268 -0
data/lib/nba_stats.rb
ADDED
data/nba_stats.gemspec
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'nba_stats/version'
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = "nba_stats"
|
|
8
|
+
spec.version = NbaStats::VERSION
|
|
9
|
+
spec.authors = ["Daniel Grzelak"]
|
|
10
|
+
spec.email = ["dan.grzelak@gmail.com"]
|
|
11
|
+
spec.summary = %q{A ruby interface for the stats.nba.com json API.}
|
|
12
|
+
spec.description = spec.summary
|
|
13
|
+
spec.homepage = ""
|
|
14
|
+
spec.license = "MIT"
|
|
15
|
+
|
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
19
|
+
spec.require_paths = ["lib"]
|
|
20
|
+
|
|
21
|
+
spec.add_dependency 'json', '~> 1.8'
|
|
22
|
+
spec.add_dependency 'rest-client', '~> 1.7'
|
|
23
|
+
spec.add_dependency 'addressable', '~> 2.3'
|
|
24
|
+
|
|
25
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
|
26
|
+
spec.add_development_dependency "rake"
|
|
27
|
+
spec.add_development_dependency "rspec"
|
|
28
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'NbaStats' do
|
|
4
|
+
|
|
5
|
+
describe 'client' do
|
|
6
|
+
client = NbaStats::Client.new
|
|
7
|
+
|
|
8
|
+
describe '.box_score_advanced' do
|
|
9
|
+
box_score_advanced = client.box_score_advanced('0021300901')
|
|
10
|
+
it 'should return a box_score_advanced resource' do
|
|
11
|
+
expect(box_score_advanced).to be_a NbaStats::Resources::BoxScoreAdvanced
|
|
12
|
+
end
|
|
13
|
+
it 'should be named box_score' do
|
|
14
|
+
expect(box_score_advanced.name).to eq 'boxscore'
|
|
15
|
+
end
|
|
16
|
+
NbaStats::Resources::BoxScoreAdvanced::VALID_RESULT_SETS.each do |valid_result_set|
|
|
17
|
+
describe ".#{valid_result_set}" do
|
|
18
|
+
it 'should return an Array' do
|
|
19
|
+
expect(box_score_advanced.send(valid_result_set)).to be_a Array
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
it 'should return 1 game' do
|
|
24
|
+
expect(box_score_advanced.game_summary.count).to eq 1
|
|
25
|
+
end
|
|
26
|
+
end # .box_score_advanced
|
|
27
|
+
|
|
28
|
+
end # client
|
|
29
|
+
|
|
30
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'NbaStats' do
|
|
4
|
+
|
|
5
|
+
describe 'client' do
|
|
6
|
+
client = NbaStats::Client.new
|
|
7
|
+
|
|
8
|
+
describe '.box_score_four_factors' do
|
|
9
|
+
box_score_four_factors = client.box_score_four_factors('0021300901')
|
|
10
|
+
it 'should return a box_score_four_factors resource' do
|
|
11
|
+
expect(box_score_four_factors).to be_a NbaStats::Resources::BoxScoreFourFactors
|
|
12
|
+
end
|
|
13
|
+
it 'should be named box_score' do
|
|
14
|
+
expect(box_score_four_factors.name).to eq 'boxscore'
|
|
15
|
+
end
|
|
16
|
+
NbaStats::Resources::BoxScoreFourFactors::VALID_RESULT_SETS.each do |valid_result_set|
|
|
17
|
+
describe ".#{valid_result_set}" do
|
|
18
|
+
it 'should return an Array' do
|
|
19
|
+
expect(box_score_four_factors.send(valid_result_set)).to be_a Array
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
it 'should return 1 game' do
|
|
24
|
+
expect(box_score_four_factors.game_summary.count).to eq 1
|
|
25
|
+
end
|
|
26
|
+
end # .box_score_four_factors
|
|
27
|
+
|
|
28
|
+
end # client
|
|
29
|
+
|
|
30
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'NbaStats' do
|
|
4
|
+
|
|
5
|
+
describe 'client' do
|
|
6
|
+
client = NbaStats::Client.new
|
|
7
|
+
|
|
8
|
+
describe '.box_score_misc' do
|
|
9
|
+
box_score_misc = client.box_score_misc('0021300901')
|
|
10
|
+
it 'should return a box_score_misc resource' do
|
|
11
|
+
expect(box_score_misc).to be_a NbaStats::Resources::BoxScoreMisc
|
|
12
|
+
end
|
|
13
|
+
it 'should be named box_score' do
|
|
14
|
+
expect(box_score_misc.name).to eq 'boxscore'
|
|
15
|
+
end
|
|
16
|
+
NbaStats::Resources::BoxScoreMisc::VALID_RESULT_SETS.each do |valid_result_set|
|
|
17
|
+
describe ".#{valid_result_set}" do
|
|
18
|
+
it 'should return an Array' do
|
|
19
|
+
expect(box_score_misc.send(valid_result_set)).to be_a Array
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
it 'should return 1 game' do
|
|
24
|
+
expect(box_score_misc.game_summary.count).to eq 1
|
|
25
|
+
end
|
|
26
|
+
end # .box_score_misc
|
|
27
|
+
|
|
28
|
+
end # client
|
|
29
|
+
|
|
30
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'NbaStats' do
|
|
4
|
+
|
|
5
|
+
describe 'client' do
|
|
6
|
+
client = NbaStats::Client.new
|
|
7
|
+
|
|
8
|
+
describe '.box_score_scoring' do
|
|
9
|
+
box_score_scoring = client.box_score_scoring('0021300901')
|
|
10
|
+
it 'should return a box_score_scoring resource' do
|
|
11
|
+
expect(box_score_scoring).to be_a NbaStats::Resources::BoxScoreScoring
|
|
12
|
+
end
|
|
13
|
+
it 'should be named box_score' do
|
|
14
|
+
expect(box_score_scoring.name).to eq 'boxscore'
|
|
15
|
+
end
|
|
16
|
+
NbaStats::Resources::BoxScoreScoring::VALID_RESULT_SETS.each do |valid_result_set|
|
|
17
|
+
describe ".#{valid_result_set}" do
|
|
18
|
+
it 'should return an Array' do
|
|
19
|
+
expect(box_score_scoring.send(valid_result_set)).to be_a Array
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
it 'should return 1 game' do
|
|
24
|
+
expect(box_score_scoring.game_summary.count).to eq 1
|
|
25
|
+
end
|
|
26
|
+
end # .box_score_scoring
|
|
27
|
+
|
|
28
|
+
end # client
|
|
29
|
+
|
|
30
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'NbaStats' do
|
|
4
|
+
|
|
5
|
+
describe 'client' do
|
|
6
|
+
client = NbaStats::Client.new
|
|
7
|
+
|
|
8
|
+
describe '.box_score' do
|
|
9
|
+
box_score = client.box_score('0021300764')
|
|
10
|
+
it 'should return a box_score resource' do
|
|
11
|
+
expect(box_score).to be_a NbaStats::Resources::BoxScore
|
|
12
|
+
end
|
|
13
|
+
it 'should be named box_score' do
|
|
14
|
+
expect(box_score.name).to eq 'boxscore'
|
|
15
|
+
end
|
|
16
|
+
NbaStats::Resources::BoxScore::VALID_RESULT_SETS.each do |valid_result_set|
|
|
17
|
+
describe ".#{valid_result_set}" do
|
|
18
|
+
it 'should return an Array' do
|
|
19
|
+
expect(box_score.send(valid_result_set)).to be_a Array
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
it 'should return 1 game' do
|
|
24
|
+
expect(box_score.game_summary.count).to eq 1
|
|
25
|
+
end
|
|
26
|
+
end # .box_score
|
|
27
|
+
|
|
28
|
+
end # client
|
|
29
|
+
|
|
30
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'NbaStats' do
|
|
4
|
+
|
|
5
|
+
describe 'client' do
|
|
6
|
+
client = NbaStats::Client.new
|
|
7
|
+
|
|
8
|
+
describe '.box_score_usage' do
|
|
9
|
+
box_score_usage = client.box_score_usage('0021300901')
|
|
10
|
+
it 'should return a box_score_usage resource' do
|
|
11
|
+
expect(box_score_usage).to be_a NbaStats::Resources::BoxScoreUsage
|
|
12
|
+
end
|
|
13
|
+
it 'should be named box_score' do
|
|
14
|
+
expect(box_score_usage.name).to eq 'boxscore'
|
|
15
|
+
end
|
|
16
|
+
NbaStats::Resources::BoxScoreUsage::VALID_RESULT_SETS.each do |valid_result_set|
|
|
17
|
+
describe ".#{valid_result_set}" do
|
|
18
|
+
it 'should return an Array' do
|
|
19
|
+
expect(box_score_usage.send(valid_result_set)).to be_a Array
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
it 'should return 1 game' do
|
|
24
|
+
expect(box_score_usage.game_summary.count).to eq 1
|
|
25
|
+
end
|
|
26
|
+
end # .box_score_usage
|
|
27
|
+
|
|
28
|
+
end # client
|
|
29
|
+
|
|
30
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'NbaStats' do
|
|
4
|
+
|
|
5
|
+
describe 'client' do
|
|
6
|
+
client = NbaStats::Client.new
|
|
7
|
+
|
|
8
|
+
describe '.common_all_players' do
|
|
9
|
+
common_all_players = client.common_all_players('2013-14')
|
|
10
|
+
it 'should return a common_all_players resource' do
|
|
11
|
+
expect(common_all_players).to be_a NbaStats::Resources::CommonAllPlayers
|
|
12
|
+
end
|
|
13
|
+
it 'should be named common_all_players' do
|
|
14
|
+
expect(common_all_players.name).to eq 'commonallplayers'
|
|
15
|
+
end
|
|
16
|
+
NbaStats::Resources::CommonAllPlayers::VALID_RESULT_SETS.each do |valid_result_set|
|
|
17
|
+
describe ".#{valid_result_set}" do
|
|
18
|
+
it 'should return an Array' do
|
|
19
|
+
expect(common_all_players.send(valid_result_set)).to be_a Array
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end # .common_all_players
|
|
24
|
+
|
|
25
|
+
end # client
|
|
26
|
+
|
|
27
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'NbaStats' do
|
|
4
|
+
|
|
5
|
+
describe 'client' do
|
|
6
|
+
client = NbaStats::Client.new
|
|
7
|
+
|
|
8
|
+
describe '.common_player_info' do
|
|
9
|
+
common_player_info = client.common_player_info(201567)
|
|
10
|
+
it 'should return a common_player_info resource' do
|
|
11
|
+
expect(common_player_info).to be_a NbaStats::Resources::CommonPlayerInfo
|
|
12
|
+
end
|
|
13
|
+
it 'should be named common_player_info' do
|
|
14
|
+
expect(common_player_info.name).to eq 'commonplayerinfo'
|
|
15
|
+
end
|
|
16
|
+
NbaStats::Resources::CommonPlayerInfo::VALID_RESULT_SETS.each do |valid_result_set|
|
|
17
|
+
describe ".#{valid_result_set}" do
|
|
18
|
+
it 'should return an Array' do
|
|
19
|
+
expect(common_player_info.send(valid_result_set)).to be_a Array
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
it 'should return 1 player' do
|
|
24
|
+
expect(common_player_info.common_player_info.count).to eq 1
|
|
25
|
+
end
|
|
26
|
+
it 'should return info about Kevin Love' do
|
|
27
|
+
expect(common_player_info.player_headline_stats[0][:player_name]).to eq 'Kevin Love'
|
|
28
|
+
end
|
|
29
|
+
end # .common_player_info
|
|
30
|
+
|
|
31
|
+
end # client
|
|
32
|
+
|
|
33
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'NbaStats' do
|
|
4
|
+
|
|
5
|
+
describe 'client' do
|
|
6
|
+
client = NbaStats::Client.new
|
|
7
|
+
|
|
8
|
+
describe '.common_team_roster' do
|
|
9
|
+
common_team_roster = client.common_team_roster(1610612746, '2013-14')
|
|
10
|
+
it 'should return a common_team_roster resource' do
|
|
11
|
+
expect(common_team_roster).to be_a NbaStats::Resources::CommonTeamRoster
|
|
12
|
+
end
|
|
13
|
+
it 'should be named common_team_roster' do
|
|
14
|
+
expect(common_team_roster.name).to eq 'commonteamroster'
|
|
15
|
+
end
|
|
16
|
+
NbaStats::Resources::CommonTeamRoster::VALID_RESULT_SETS.each do |valid_result_set|
|
|
17
|
+
describe ".#{valid_result_set}" do
|
|
18
|
+
it 'should return an Array' do
|
|
19
|
+
expect(common_team_roster.send(valid_result_set)).to be_a Array
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end # .common_team_roster
|
|
24
|
+
|
|
25
|
+
end # client
|
|
26
|
+
|
|
27
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'NbaStats' do
|
|
4
|
+
|
|
5
|
+
describe 'client' do
|
|
6
|
+
client = NbaStats::Client.new
|
|
7
|
+
|
|
8
|
+
describe '.common_team_years' do
|
|
9
|
+
common_team_years = client.common_team_years
|
|
10
|
+
it 'should return a common_team_years resource' do
|
|
11
|
+
expect(common_team_years).to be_a NbaStats::Resources::CommonTeamYears
|
|
12
|
+
end
|
|
13
|
+
it 'should be named common_team_years' do
|
|
14
|
+
expect(common_team_years.name).to eq 'commonteamyears'
|
|
15
|
+
end
|
|
16
|
+
NbaStats::Resources::CommonTeamYears::VALID_RESULT_SETS.each do |valid_result_set|
|
|
17
|
+
describe ".#{valid_result_set}" do
|
|
18
|
+
it 'should return an Array' do
|
|
19
|
+
expect(common_team_years.send(valid_result_set)).to be_a Array
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end # .common_team_years
|
|
24
|
+
|
|
25
|
+
end # client
|
|
26
|
+
|
|
27
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'NbaStats' do
|
|
4
|
+
|
|
5
|
+
describe 'client' do
|
|
6
|
+
client = NbaStats::Client.new
|
|
7
|
+
|
|
8
|
+
describe '.draft_combine_drill_results' do
|
|
9
|
+
draft_combine_drill_results = client.draft_combine_drill_results('2014-15')
|
|
10
|
+
it 'should return a draft_combine_drill_results resource' do
|
|
11
|
+
expect(draft_combine_drill_results).to be_a NbaStats::Resources::DraftCombineDrillResults
|
|
12
|
+
end
|
|
13
|
+
it 'should be named draft_combine_drill_results' do
|
|
14
|
+
expect(draft_combine_drill_results.name).to eq 'draftcombinedrillresults'
|
|
15
|
+
end
|
|
16
|
+
NbaStats::Resources::DraftCombineDrillResults::VALID_RESULT_SETS.each do |valid_result_set|
|
|
17
|
+
describe ".#{valid_result_set}" do
|
|
18
|
+
it 'should return an Array' do
|
|
19
|
+
expect(draft_combine_drill_results.send(valid_result_set)).to be_a Array
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end # .draft_combine_drill_results
|
|
24
|
+
|
|
25
|
+
end # client
|
|
26
|
+
|
|
27
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'NbaStats' do
|
|
4
|
+
|
|
5
|
+
describe 'client' do
|
|
6
|
+
client = NbaStats::Client.new
|
|
7
|
+
|
|
8
|
+
describe '.draft_combine_non_stationary_shooting' do
|
|
9
|
+
draft_combine_non_stationary_shooting = client.draft_combine_non_stationary_shooting('2014-15')
|
|
10
|
+
it 'should return a draft_combine_non_stationary_shooting resource' do
|
|
11
|
+
expect(draft_combine_non_stationary_shooting).to be_a NbaStats::Resources::DraftCombineNonStationaryShooting
|
|
12
|
+
end
|
|
13
|
+
it 'should be named draft_combine_non_stationary_shooting' do
|
|
14
|
+
expect(draft_combine_non_stationary_shooting.name).to eq 'draftcombinenonstationaryshooting'
|
|
15
|
+
end
|
|
16
|
+
NbaStats::Resources::DraftCombineNonStationaryShooting::VALID_RESULT_SETS.each do |valid_result_set|
|
|
17
|
+
describe ".#{valid_result_set}" do
|
|
18
|
+
it 'should return an Array' do
|
|
19
|
+
expect(draft_combine_non_stationary_shooting.send(valid_result_set)).to be_a Array
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end # .draft_combine_non_stationary_shooting
|
|
24
|
+
|
|
25
|
+
end # client
|
|
26
|
+
|
|
27
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'NbaStats' do
|
|
4
|
+
|
|
5
|
+
describe 'client' do
|
|
6
|
+
client = NbaStats::Client.new
|
|
7
|
+
|
|
8
|
+
describe '.draft_combine_player_anthro' do
|
|
9
|
+
draft_combine_player_anthro = client.draft_combine_player_anthro('2014-15')
|
|
10
|
+
it 'should return a draft_combine_player_anthro resource' do
|
|
11
|
+
expect(draft_combine_player_anthro).to be_a NbaStats::Resources::DraftCombinePlayerAnthro
|
|
12
|
+
end
|
|
13
|
+
it 'should be named draft_combine_player_anthro' do
|
|
14
|
+
expect(draft_combine_player_anthro.name).to eq 'draftcombineplayeranthro'
|
|
15
|
+
end
|
|
16
|
+
NbaStats::Resources::DraftCombinePlayerAnthro::VALID_RESULT_SETS.each do |valid_result_set|
|
|
17
|
+
describe ".#{valid_result_set}" do
|
|
18
|
+
it 'should return an Array' do
|
|
19
|
+
expect(draft_combine_player_anthro.send(valid_result_set)).to be_a Array
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end # .draft_combine_player_anthro
|
|
24
|
+
|
|
25
|
+
end # client
|
|
26
|
+
|
|
27
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'NbaStats' do
|
|
4
|
+
|
|
5
|
+
describe 'client' do
|
|
6
|
+
client = NbaStats::Client.new
|
|
7
|
+
|
|
8
|
+
describe '.draft_combine_spot_shooting' do
|
|
9
|
+
draft_combine_spot_shooting = client.draft_combine_spot_shooting('2014-15')
|
|
10
|
+
it 'should return a draft_combine_spot_shooting resource' do
|
|
11
|
+
expect(draft_combine_spot_shooting).to be_a NbaStats::Resources::DraftCombineSpotShooting
|
|
12
|
+
end
|
|
13
|
+
it 'should be named draft_combine_spot_shooting' do
|
|
14
|
+
expect(draft_combine_spot_shooting.name).to eq 'draftcombinespotshooting'
|
|
15
|
+
end
|
|
16
|
+
NbaStats::Resources::DraftCombineSpotShooting::VALID_RESULT_SETS.each do |valid_result_set|
|
|
17
|
+
describe ".#{valid_result_set}" do
|
|
18
|
+
it 'should return an Array' do
|
|
19
|
+
expect(draft_combine_spot_shooting.send(valid_result_set)).to be_a Array
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end # .draft_combine_spot_shooting
|
|
24
|
+
|
|
25
|
+
end # client
|
|
26
|
+
|
|
27
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'NbaStats' do
|
|
4
|
+
|
|
5
|
+
describe 'client' do
|
|
6
|
+
client = NbaStats::Client.new
|
|
7
|
+
|
|
8
|
+
describe '.draft_combine_stats' do
|
|
9
|
+
draft_combine_stats = client.draft_combine_stats('2014-15')
|
|
10
|
+
it 'should return a draft_combine_stats resource' do
|
|
11
|
+
expect(draft_combine_stats).to be_a NbaStats::Resources::DraftCombineStats
|
|
12
|
+
end
|
|
13
|
+
it 'should be named draft_combine_stats' do
|
|
14
|
+
expect(draft_combine_stats.name).to eq 'draftcombinestats'
|
|
15
|
+
end
|
|
16
|
+
NbaStats::Resources::DraftCombineStats::VALID_RESULT_SETS.each do |valid_result_set|
|
|
17
|
+
describe ".#{valid_result_set}" do
|
|
18
|
+
it 'should return an Array' do
|
|
19
|
+
expect(draft_combine_stats.send(valid_result_set)).to be_a Array
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end # .draft_combine_stats
|
|
24
|
+
|
|
25
|
+
end # client
|
|
26
|
+
|
|
27
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'NbaStats' do
|
|
4
|
+
|
|
5
|
+
describe 'client' do
|
|
6
|
+
client = NbaStats::Client.new
|
|
7
|
+
|
|
8
|
+
describe '.franchise_history' do
|
|
9
|
+
franchise_history = client.franchise_history('00')
|
|
10
|
+
it 'should return a franchise_history resource' do
|
|
11
|
+
expect(franchise_history).to be_a NbaStats::Resources::FranchiseHistory
|
|
12
|
+
end
|
|
13
|
+
it 'should be named franchise_history' do
|
|
14
|
+
expect(franchise_history.name).to eq 'franchisehistory'
|
|
15
|
+
end
|
|
16
|
+
NbaStats::Resources::FranchiseHistory::VALID_RESULT_SETS.each do |valid_result_set|
|
|
17
|
+
describe ".#{valid_result_set}" do
|
|
18
|
+
it 'should return an Array' do
|
|
19
|
+
expect(franchise_history.send(valid_result_set)).to be_a Array
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
it 'should return the same league id as provided' do
|
|
24
|
+
expect(franchise_history.franchise_history[0][:league_id]).to eq '00'
|
|
25
|
+
end
|
|
26
|
+
end # .franchise_history
|
|
27
|
+
|
|
28
|
+
end # client
|
|
29
|
+
|
|
30
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'NbaStats' do
|
|
4
|
+
|
|
5
|
+
describe 'client' do
|
|
6
|
+
client = NbaStats::Client.new
|
|
7
|
+
|
|
8
|
+
describe '.home_page_leaders' do
|
|
9
|
+
home_page_leaders = client.home_page_leaders('2013-14')
|
|
10
|
+
it 'should return a home_page_leaders resource' do
|
|
11
|
+
expect(home_page_leaders).to be_a NbaStats::Resources::HomePageLeaders
|
|
12
|
+
end
|
|
13
|
+
it 'should be named home_page_leaders' do
|
|
14
|
+
expect(home_page_leaders.name).to eq 'homepageleaders'
|
|
15
|
+
end
|
|
16
|
+
NbaStats::Resources::HomePageLeaders::VALID_RESULT_SETS.each do |valid_result_set|
|
|
17
|
+
describe ".#{valid_result_set}" do
|
|
18
|
+
it 'should return an Array' do
|
|
19
|
+
expect(home_page_leaders.send(valid_result_set)).to be_a Array
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end # .home_page_leaders
|
|
24
|
+
|
|
25
|
+
end # client
|
|
26
|
+
|
|
27
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'NbaStats' do
|
|
4
|
+
|
|
5
|
+
describe 'client' do
|
|
6
|
+
client = NbaStats::Client.new
|
|
7
|
+
|
|
8
|
+
describe '.league_dash_lineups' do
|
|
9
|
+
league_dash_lineups = client.league_dash_lineups('2013-14')
|
|
10
|
+
it 'should return a league_dash_lineups resource' do
|
|
11
|
+
expect(league_dash_lineups).to be_a NbaStats::Resources::LeagueDashLineups
|
|
12
|
+
end
|
|
13
|
+
it 'should be named league_dash_lineups' do
|
|
14
|
+
expect(league_dash_lineups.name).to eq 'leaguedashlineups'
|
|
15
|
+
end
|
|
16
|
+
NbaStats::Resources::LeagueDashLineups::VALID_RESULT_SETS.each do |valid_result_set|
|
|
17
|
+
describe ".#{valid_result_set}" do
|
|
18
|
+
it 'should return an Array' do
|
|
19
|
+
expect(league_dash_lineups.send(valid_result_set)).to be_a Array
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end # .league_dash_lineups
|
|
24
|
+
|
|
25
|
+
end # client
|
|
26
|
+
|
|
27
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'NbaStats' do
|
|
4
|
+
|
|
5
|
+
describe 'client' do
|
|
6
|
+
client = NbaStats::Client.new
|
|
7
|
+
|
|
8
|
+
describe '.league_dash_player_stats' do
|
|
9
|
+
league_dash_player_stats = client.league_dash_player_stats('2013-14')
|
|
10
|
+
it 'should return a league_dash_player_stats resource' do
|
|
11
|
+
expect(league_dash_player_stats).to be_a NbaStats::Resources::LeagueDashPlayerStats
|
|
12
|
+
end
|
|
13
|
+
it 'should be named league_dash_player_stats' do
|
|
14
|
+
expect(league_dash_player_stats.name).to eq 'leaguedashplayerstats'
|
|
15
|
+
end
|
|
16
|
+
NbaStats::Resources::LeagueDashPlayerStats::VALID_RESULT_SETS.each do |valid_result_set|
|
|
17
|
+
describe ".#{valid_result_set}" do
|
|
18
|
+
it 'should return an Array' do
|
|
19
|
+
expect(league_dash_player_stats.send(valid_result_set)).to be_a Array
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end # .league_dash_player_stats
|
|
24
|
+
|
|
25
|
+
end # client
|
|
26
|
+
|
|
27
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'NbaStats' do
|
|
4
|
+
|
|
5
|
+
describe 'client' do
|
|
6
|
+
client = NbaStats::Client.new
|
|
7
|
+
|
|
8
|
+
describe '.play_by_play' do
|
|
9
|
+
play_by_play = client.play_by_play('0021301230')
|
|
10
|
+
it 'should return a play_by_play resource' do
|
|
11
|
+
expect(play_by_play).to be_a NbaStats::Resources::PlayByPlay
|
|
12
|
+
end
|
|
13
|
+
it 'should be named play_by_play' do
|
|
14
|
+
expect(play_by_play.name).to eq 'playbyplay'
|
|
15
|
+
end
|
|
16
|
+
NbaStats::Resources::PlayByPlay::VALID_RESULT_SETS.each do |valid_result_set|
|
|
17
|
+
describe ".#{valid_result_set}" do
|
|
18
|
+
it 'should return an Array' do
|
|
19
|
+
expect(play_by_play.send(valid_result_set)).to be_a Array
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
it 'should return the same game id as requested' do
|
|
24
|
+
expect(play_by_play.play_by_play[0][:game_id]).to eq '0021301230'
|
|
25
|
+
end
|
|
26
|
+
end # .play_by_play
|
|
27
|
+
|
|
28
|
+
end # client
|
|
29
|
+
|
|
30
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'NbaStats' do
|
|
4
|
+
|
|
5
|
+
describe 'client' do
|
|
6
|
+
client = NbaStats::Client.new
|
|
7
|
+
|
|
8
|
+
describe '.player_career_stats' do
|
|
9
|
+
player_career_stats = client.player_career_stats(201609)
|
|
10
|
+
it 'should return a player_career_stats resource' do
|
|
11
|
+
expect(player_career_stats).to be_a NbaStats::Resources::PlayerCareerStats
|
|
12
|
+
end
|
|
13
|
+
it 'should be named player_career_stats' do
|
|
14
|
+
expect(player_career_stats.name).to eq 'playercareerstats'
|
|
15
|
+
end
|
|
16
|
+
NbaStats::Resources::PlayerCareerStats::VALID_RESULT_SETS.each do |valid_result_set|
|
|
17
|
+
describe ".#{valid_result_set}" do
|
|
18
|
+
it 'should return an Array' do
|
|
19
|
+
expect(player_career_stats.send(valid_result_set)).to be_a Array
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
it 'should return the same player id as requested' do
|
|
24
|
+
expect(player_career_stats.career_totals_regular_season[0][:player_id]).to eq 201609
|
|
25
|
+
end
|
|
26
|
+
end # .player_career_stats
|
|
27
|
+
|
|
28
|
+
end # client
|
|
29
|
+
|
|
30
|
+
end
|