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.
Files changed (111) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +22 -0
  3. data/.idea/.name +1 -0
  4. data/.idea/.rakeTasks +7 -0
  5. data/.idea/encodings.xml +5 -0
  6. data/.idea/misc.xml +21 -0
  7. data/.idea/modules.xml +9 -0
  8. data/.idea/nba_stats.iml +43 -0
  9. data/.idea/scopes/scope_settings.xml +5 -0
  10. data/.idea/vcs.xml +7 -0
  11. data/.idea/workspace.xml +782 -0
  12. data/Gemfile +4 -0
  13. data/LICENSE.txt +22 -0
  14. data/README.md +68 -0
  15. data/Rakefile +45 -0
  16. data/lib/nba_stats/client.rb +135 -0
  17. data/lib/nba_stats/configuration.rb +37 -0
  18. data/lib/nba_stats/constants.rb +96 -0
  19. data/lib/nba_stats/discovery/discovery.rb +193 -0
  20. data/lib/nba_stats/errors.rb +9 -0
  21. data/lib/nba_stats/helper.rb +10 -0
  22. data/lib/nba_stats/resources/box_score.rb +35 -0
  23. data/lib/nba_stats/resources/box_score_advanced.rb +38 -0
  24. data/lib/nba_stats/resources/box_score_four_factors.rb +38 -0
  25. data/lib/nba_stats/resources/box_score_misc.rb +38 -0
  26. data/lib/nba_stats/resources/box_score_scoring.rb +38 -0
  27. data/lib/nba_stats/resources/box_score_usage.rb +38 -0
  28. data/lib/nba_stats/resources/common_all_players.rb +23 -0
  29. data/lib/nba_stats/resources/common_player_info.rb +24 -0
  30. data/lib/nba_stats/resources/common_team_roster.rb +24 -0
  31. data/lib/nba_stats/resources/common_team_years.rb +24 -0
  32. data/lib/nba_stats/resources/draft_combine_drill_results.rb +24 -0
  33. data/lib/nba_stats/resources/draft_combine_non_stationary_shooting.rb +24 -0
  34. data/lib/nba_stats/resources/draft_combine_player_anthro.rb +24 -0
  35. data/lib/nba_stats/resources/draft_combine_spot_shooting.rb +24 -0
  36. data/lib/nba_stats/resources/draft_combine_stats.rb +24 -0
  37. data/lib/nba_stats/resources/franchise_history.rb +25 -0
  38. data/lib/nba_stats/resources/home_page_leaders.rb +26 -0
  39. data/lib/nba_stats/resources/league_dash_lineups.rb +24 -0
  40. data/lib/nba_stats/resources/league_dash_player_stats.rb +24 -0
  41. data/lib/nba_stats/resources/play_by_play.rb +25 -0
  42. data/lib/nba_stats/resources/player_career_stats.rb +29 -0
  43. data/lib/nba_stats/resources/player_profile.rb +31 -0
  44. data/lib/nba_stats/resources/resource_base.rb +86 -0
  45. data/lib/nba_stats/resources/scoreboard.rb +29 -0
  46. data/lib/nba_stats/resources/shot_chart_detail.rb +25 -0
  47. data/lib/nba_stats/resources/team_game_log.rb +23 -0
  48. data/lib/nba_stats/resources/team_info_common.rb +24 -0
  49. data/lib/nba_stats/resources/team_year_by_year_stats.rb +24 -0
  50. data/lib/nba_stats/stats/box_score.rb +42 -0
  51. data/lib/nba_stats/stats/box_score_advanced.rb +41 -0
  52. data/lib/nba_stats/stats/box_score_four_factors.rb +41 -0
  53. data/lib/nba_stats/stats/box_score_misc.rb +41 -0
  54. data/lib/nba_stats/stats/box_score_scoring.rb +41 -0
  55. data/lib/nba_stats/stats/box_score_usage.rb +41 -0
  56. data/lib/nba_stats/stats/common_all_players.rb +33 -0
  57. data/lib/nba_stats/stats/common_player_info.rb +33 -0
  58. data/lib/nba_stats/stats/common_team_roster.rb +33 -0
  59. data/lib/nba_stats/stats/common_team_years.rb +26 -0
  60. data/lib/nba_stats/stats/draft_combine_drill_results.rb +29 -0
  61. data/lib/nba_stats/stats/draft_combine_non_stationary_shooting.rb +29 -0
  62. data/lib/nba_stats/stats/draft_combine_player_anthro.rb +29 -0
  63. data/lib/nba_stats/stats/draft_combine_spot_shooting.rb +29 -0
  64. data/lib/nba_stats/stats/draft_combine_stats.rb +29 -0
  65. data/lib/nba_stats/stats/franchise_history.rb +26 -0
  66. data/lib/nba_stats/stats/home_page_leaders.rb +44 -0
  67. data/lib/nba_stats/stats/league_dash_lineups.rb +107 -0
  68. data/lib/nba_stats/stats/league_dash_player_stats.rb +104 -0
  69. data/lib/nba_stats/stats/play_by_play.rb +32 -0
  70. data/lib/nba_stats/stats/player_career_stats.rb +32 -0
  71. data/lib/nba_stats/stats/player_profile.rb +45 -0
  72. data/lib/nba_stats/stats/scoreboard.rb +33 -0
  73. data/lib/nba_stats/stats/shot_chart_detail.rb +95 -0
  74. data/lib/nba_stats/stats/team_game_log.rb +36 -0
  75. data/lib/nba_stats/stats/team_info_common.rb +36 -0
  76. data/lib/nba_stats/stats/team_year_by_year_stats.rb +38 -0
  77. data/lib/nba_stats/version.rb +3 -0
  78. data/lib/nba_stats.rb +8 -0
  79. data/nba_stats.gemspec +28 -0
  80. data/spec/client/box_score_advanced_spec.rb +30 -0
  81. data/spec/client/box_score_four_factors_spec.rb +30 -0
  82. data/spec/client/box_score_misc_spec.rb +30 -0
  83. data/spec/client/box_score_scoring_spec.rb +30 -0
  84. data/spec/client/box_score_spec.rb +30 -0
  85. data/spec/client/box_score_usage_spec.rb +30 -0
  86. data/spec/client/common_all_players_spec.rb +27 -0
  87. data/spec/client/common_player_info_spec.rb +33 -0
  88. data/spec/client/common_team_roster_spec.rb +27 -0
  89. data/spec/client/common_team_years_spec.rb +27 -0
  90. data/spec/client/draft_combine_drill_results_spec.rb +27 -0
  91. data/spec/client/draft_combine_non_stationary_shooting_spec.rb +27 -0
  92. data/spec/client/draft_combine_player_anthro_spec.rb +27 -0
  93. data/spec/client/draft_combine_spot_shooting_spec.rb +27 -0
  94. data/spec/client/draft_combine_stats_spec.rb +27 -0
  95. data/spec/client/franchise_history_spec.rb +30 -0
  96. data/spec/client/home_page_leaders_spec.rb +27 -0
  97. data/spec/client/league_dash_lineups_spec.rb +27 -0
  98. data/spec/client/league_dash_player_stats_spec.rb +27 -0
  99. data/spec/client/play_by_play_spec.rb +30 -0
  100. data/spec/client/player_career_stats_spec.rb +30 -0
  101. data/spec/client/player_profile_spec.rb +30 -0
  102. data/spec/client/scoreboard_spec.rb +30 -0
  103. data/spec/client/shot_chart_detail_spec.rb +27 -0
  104. data/spec/client/team_game_log_spec.rb +27 -0
  105. data/spec/client/team_info_common_spec.rb +30 -0
  106. data/spec/client/team_year_by_year_stats_spec.rb +30 -0
  107. data/spec/client_spec.rb +17 -0
  108. data/spec/configuration_spec.rb +38 -0
  109. data/spec/nba_stats_spec.rb +13 -0
  110. data/spec/spec_helper.rb +21 -0
  111. metadata +268 -0
@@ -0,0 +1,3 @@
1
+ module NbaStats
2
+ VERSION = '0.9.0'
3
+ end
data/lib/nba_stats.rb ADDED
@@ -0,0 +1,8 @@
1
+ require 'nba_stats/version'
2
+ require 'nba_stats/configuration'
3
+ require 'nba_stats/client'
4
+ require 'nba_stats/constants'
5
+
6
+ module NbaStats
7
+ extend Configuration
8
+ end
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