sports_data_api 0.1.0 → 0.2.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 (80) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +1 -0
  4. data/README.md +6 -6
  5. data/lib/sports_data_api.rb +2 -0
  6. data/lib/sports_data_api/nfl.rb +28 -16
  7. data/lib/sports_data_api/nfl/broadcast.rb +6 -7
  8. data/lib/sports_data_api/nfl/game.rb +17 -22
  9. data/lib/sports_data_api/nfl/games.rb +7 -8
  10. data/lib/sports_data_api/nfl/player.rb +5 -7
  11. data/lib/sports_data_api/nfl/player_season_stats.rb +3 -13
  12. data/lib/sports_data_api/nfl/season.rb +5 -7
  13. data/lib/sports_data_api/nfl/team.rb +50 -11
  14. data/lib/sports_data_api/nfl/team_roster.rb +2 -5
  15. data/lib/sports_data_api/nfl/team_season_stats.rb +4 -9
  16. data/lib/sports_data_api/nfl/teams.rb +9 -15
  17. data/lib/sports_data_api/nfl/venue.rb +12 -13
  18. data/lib/sports_data_api/nfl/weather.rb +7 -8
  19. data/lib/sports_data_api/nfl/week.rb +4 -6
  20. data/lib/sports_data_api/nhl.rb +71 -0
  21. data/lib/sports_data_api/nhl/broadcast.rb +14 -0
  22. data/lib/sports_data_api/nhl/game.rb +54 -0
  23. data/lib/sports_data_api/nhl/games.rb +26 -0
  24. data/lib/sports_data_api/nhl/player.rb +31 -0
  25. data/lib/sports_data_api/nhl/season.rb +28 -0
  26. data/lib/sports_data_api/nhl/team.rb +40 -0
  27. data/lib/sports_data_api/nhl/teams.rb +83 -0
  28. data/lib/sports_data_api/nhl/venue.rb +20 -0
  29. data/lib/sports_data_api/stats.rb +6 -2
  30. data/lib/sports_data_api/version.rb +1 -1
  31. data/spec/cassettes/sports_data_api_mlb_game.yml +19926 -19688
  32. data/spec/cassettes/sports_data_api_mlb_game_boxscore.yml +24 -18
  33. data/spec/cassettes/sports_data_api_mlb_game_stats.yml +576 -574
  34. data/spec/cassettes/sports_data_api_mlb_games.yml +152 -147
  35. data/spec/cassettes/sports_data_api_mlb_player.yml +8459 -10660
  36. data/spec/cassettes/sports_data_api_mlb_season.yml +19926 -19688
  37. data/spec/cassettes/sports_data_api_mlb_team.yml +47 -44
  38. data/spec/cassettes/sports_data_api_mlb_team_roster.yml +8459 -10660
  39. data/spec/cassettes/sports_data_api_mlb_teams.yml +94 -130
  40. data/spec/cassettes/sports_data_api_mlb_venues.yml +16 -16
  41. data/spec/cassettes/sports_data_api_nfl.yml +5331 -18893
  42. data/spec/cassettes/sports_data_api_nfl_broadcast.yml +35 -84
  43. data/spec/cassettes/sports_data_api_nfl_game.yml +7702 -15956
  44. data/spec/cassettes/sports_data_api_nfl_games.yml +211 -884
  45. data/spec/cassettes/sports_data_api_nfl_player_season_stats.yml +1002 -959
  46. data/spec/cassettes/sports_data_api_nfl_season.yml +3168 -14065
  47. data/spec/cassettes/sports_data_api_nfl_team.yml +1264 -715
  48. data/spec/cassettes/sports_data_api_nfl_team_hierarchy.yml +462 -846
  49. data/spec/cassettes/sports_data_api_nfl_team_roster.yml +796 -580
  50. data/spec/cassettes/sports_data_api_nfl_team_season_stats.yml +1004 -945
  51. data/spec/cassettes/sports_data_api_nfl_venue.yml +35 -84
  52. data/spec/cassettes/sports_data_api_nfl_weather.yml +35 -84
  53. data/spec/cassettes/sports_data_api_nfl_week.yml +3168 -14065
  54. data/spec/cassettes/sports_data_api_nhl.yml +18999 -0
  55. data/spec/cassettes/sports_data_api_nhl_broadcast.yml +226 -0
  56. data/spec/cassettes/sports_data_api_nhl_game.yml +23261 -0
  57. data/spec/cassettes/sports_data_api_nhl_games.yml +226 -0
  58. data/spec/cassettes/sports_data_api_nhl_league_hierarchy.yml +535 -0
  59. data/spec/cassettes/sports_data_api_nhl_player.yml +396 -0
  60. data/spec/cassettes/sports_data_api_nhl_season.yml +18961 -0
  61. data/spec/cassettes/sports_data_api_nhl_team.yml +1962 -0
  62. data/spec/cassettes/sports_data_api_nhl_venue.yml +226 -0
  63. data/spec/lib/sports_data_api/mlb/players_spec.rb +1 -1
  64. data/spec/lib/sports_data_api/nfl/game_spec.rb +33 -9
  65. data/spec/lib/sports_data_api/nfl/team_spec.rb +62 -32
  66. data/spec/lib/sports_data_api/nfl/teams_spec.rb +5 -6
  67. data/spec/lib/sports_data_api/nfl/venue_spec.rb +3 -3
  68. data/spec/lib/sports_data_api/nfl_spec.rb +3 -3
  69. data/spec/lib/sports_data_api/nhl/broadcast_spec.rb +18 -0
  70. data/spec/lib/sports_data_api/nhl/game_spec.rb +87 -0
  71. data/spec/lib/sports_data_api/nhl/games_spec.rb +19 -0
  72. data/spec/lib/sports_data_api/nhl/player_spec.rb +56 -0
  73. data/spec/lib/sports_data_api/nhl/season_spec.rb +41 -0
  74. data/spec/lib/sports_data_api/nhl/team_spec.rb +240 -0
  75. data/spec/lib/sports_data_api/nhl/teams_spec.rb +76 -0
  76. data/spec/lib/sports_data_api/nhl/venue_spec.rb +24 -0
  77. data/spec/lib/sports_data_api/nhl_spec.rb +41 -0
  78. data/spec/spec_helper.rb +2 -0
  79. data/sports_data_api.gemspec +1 -0
  80. metadata +62 -3
@@ -14,12 +14,12 @@ describe SportsDataApi::Nfl::Venue, vcr: {
14
14
  subject { weekly_schedule.first.venue }
15
15
  its(:id) { should eq '6ed18563-53e0-46c2-a91d-12d73a16456d' }
16
16
  its(:name) { should eq 'Lucas Oil Stadium' }
17
- its(:address) { should eq '500 S. Capitol Avenue' }
17
+ its(:address) { should eq '500 South Capitol Avenue' }
18
18
  its(:city) { should eq 'Indianapolis' }
19
19
  its(:state) { should eq 'IN' }
20
20
  its(:zip) { '46225' }
21
- its(:country) { should eq 'US' }
22
- its(:capacity) { should eq '67000' }
21
+ its(:country) { should eq 'USA' }
22
+ its(:capacity) { should eq 67000 }
23
23
  its(:surface) { should eq 'artificial' }
24
24
  its(:type) { should eq 'retractable_dome' }
25
25
  end
@@ -36,9 +36,9 @@ describe SportsDataApi::Nfl, vcr: {
36
36
  end
37
37
 
38
38
  context 'create valid URLs' do
39
- let(:schedule_url) { 'http://api.sportsdatallc.org/nfl-t1/2012/REG/schedule.xml' }
40
- let(:boxscore_url) { 'http://api.sportsdatallc.org/nfl-t1/2012/REG/9/MIA/IND/boxscore.xml' }
41
- let(:weekly_url) { 'http://api.sportsdatallc.org/nfl-t1/2012/PRE/1/schedule.xml' }
39
+ let(:schedule_url) { 'http://api.sportsdatallc.org/nfl-t1/2012/REG/schedule.json' }
40
+ let(:boxscore_url) { 'http://api.sportsdatallc.org/nfl-t1/2012/REG/9/MIA/IND/boxscore.json' }
41
+ let(:weekly_url) { 'http://api.sportsdatallc.org/nfl-t1/2012/PRE/1/schedule.json' }
42
42
  before(:each) do
43
43
  SportsDataApi.set_key(:nfl, 'invalid_key')
44
44
  SportsDataApi.set_access_level(:nfl, 't')
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+
3
+ describe SportsDataApi::Nhl::Broadcast, vcr: {
4
+ cassette_name: 'sports_data_api_nhl_broadcast',
5
+ record: :new_episodes,
6
+ match_requests_on: [:host, :path]
7
+ } do
8
+ let(:daily_schedule) do
9
+ SportsDataApi.set_access_level(:nhl, 't')
10
+ SportsDataApi.set_key(:nhl, api_key(:nhl))
11
+ SportsDataApi::Nhl.daily(2013, 12, 12)
12
+ end
13
+ context 'results from daily schedule fetch' do
14
+ subject { daily_schedule.first.broadcast }
15
+ its(:network) { should eq 'CSN-PH' }
16
+ its(:satellite) { should eq nil }
17
+ end
18
+ end
@@ -0,0 +1,87 @@
1
+ require 'spec_helper'
2
+
3
+ describe SportsDataApi::Nhl::Game, vcr: {
4
+ cassette_name: 'sports_data_api_nhl_game',
5
+ record: :new_episodes,
6
+ match_requests_on: [:host, :path]
7
+ } do
8
+ let(:season) do
9
+ SportsDataApi.set_key(:nhl, api_key(:nhl))
10
+ SportsDataApi.set_access_level(:nhl, 't')
11
+ SportsDataApi::Nhl.schedule(2013, :REG)
12
+ end
13
+ let(:game_summary) do
14
+ SportsDataApi.set_key(:nhl, api_key(:nhl))
15
+ SportsDataApi.set_access_level(:nhl, 't')
16
+ SportsDataApi::Nhl.game_summary('f0f7e327-3a3a-410b-be75-0956c90c4988')
17
+ end
18
+ let(:daily_schedule) do
19
+ SportsDataApi.set_access_level(:nhl, 't')
20
+ SportsDataApi.set_key(:nhl, api_key(:nhl))
21
+ SportsDataApi::Nhl.daily(2013, 12, 12)
22
+ end
23
+ context 'results from schedule fetch' do
24
+ subject { season.games.first }
25
+ it { should be_an_instance_of(SportsDataApi::Nhl::Game) }
26
+ its(:id) { should eq 'f0f7e327-3a3a-410b-be75-0956c90c4988' }
27
+ its(:scheduled) { should eq Time.new(2013, 10, 01, 16, 00, 00, '-07:00') }
28
+ its(:home) { should eq '441713b7-0f24-11e2-8525-18a905767e44' }
29
+ its(:away) { should eq '441730a9-0f24-11e2-8525-18a905767e44' }
30
+ its(:status) { should eq 'closed' }
31
+ its(:home_team) { should be_an_instance_of(SportsDataApi::Nhl::Team) }
32
+ its(:away_team) { should be_an_instance_of(SportsDataApi::Nhl::Team) }
33
+ its(:venue) { should be_an_instance_of(SportsDataApi::Nhl::Venue) }
34
+ its(:broadcast) { should be_an_instance_of(SportsDataApi::Nhl::Broadcast) }
35
+ its(:summary) { should be_an_instance_of(SportsDataApi::Nhl::Game) }
36
+ it '#boxscore' do
37
+ expect { subject.boxscore }.to raise_error(NotImplementedError)
38
+ end
39
+ it '#pbp' do
40
+ expect { subject.pbp }.to raise_error(NotImplementedError)
41
+ end
42
+ end
43
+ context 'results from game_summary fetch' do
44
+ subject { game_summary }
45
+ it { should be_an_instance_of(SportsDataApi::Nhl::Game) }
46
+ its(:id) { should eq 'f0f7e327-3a3a-410b-be75-0956c90c4988' }
47
+ its(:scheduled) { should eq Time.new(2013, 10, 01, 16, 00, 00, '-07:00') }
48
+ its(:home) { should eq '441713b7-0f24-11e2-8525-18a905767e44' }
49
+ its(:away) { should eq '441730a9-0f24-11e2-8525-18a905767e44' }
50
+ its(:status) { should eq 'closed' }
51
+ its(:period) { should eq 3 }
52
+ its(:clock) { should eq "00:00" }
53
+ its(:home_team) { should be_an_instance_of(SportsDataApi::Nhl::Team) }
54
+ its(:away_team) { should be_an_instance_of(SportsDataApi::Nhl::Team) }
55
+ its(:venue) { should be_an_instance_of(SportsDataApi::Nhl::Venue) }
56
+ its(:broadcast) { should be_an_instance_of(SportsDataApi::Nhl::Broadcast) }
57
+ its(:summary) { should be_an_instance_of(SportsDataApi::Nhl::Game) }
58
+ it '#boxscore' do
59
+ expect { subject.boxscore }.to raise_error(NotImplementedError)
60
+ end
61
+ it '#pbp' do
62
+ expect { subject.pbp }.to raise_error(NotImplementedError)
63
+ end
64
+ end
65
+ context 'results from daily schedule fetch' do
66
+ subject { daily_schedule.first }
67
+ it { should be_an_instance_of(SportsDataApi::Nhl::Game) }
68
+ its(:id) { should eq 'abffac54-dc1e-4f2f-abe5-8c19a87cdad7' }
69
+ its(:scheduled) { should eq Time.new(2013, 12, 12, 16, 00, 00, '-08:00') }
70
+ its(:home) { should eq '44179d47-0f24-11e2-8525-18a905767e44' }
71
+ its(:away) { should eq '441713b7-0f24-11e2-8525-18a905767e44' }
72
+ its(:status) { should eq 'closed' }
73
+ its(:period) { should eq nil }
74
+ its(:clock) { should eq nil }
75
+ its(:home_team) { should be_an_instance_of(SportsDataApi::Nhl::Team) }
76
+ its(:away_team) { should be_an_instance_of(SportsDataApi::Nhl::Team) }
77
+ its(:venue) { should be_an_instance_of(SportsDataApi::Nhl::Venue) }
78
+ its(:broadcast) { should be_an_instance_of(SportsDataApi::Nhl::Broadcast) }
79
+ its(:summary) { should be_an_instance_of(SportsDataApi::Nhl::Game) }
80
+ it '#boxscore' do
81
+ expect { subject.boxscore }.to raise_error(NotImplementedError)
82
+ end
83
+ it '#pbp' do
84
+ expect { subject.pbp }.to raise_error(NotImplementedError)
85
+ end
86
+ end
87
+ end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ describe SportsDataApi::Nhl::Games, vcr: {
4
+ cassette_name: 'sports_data_api_nhl_games',
5
+ record: :new_episodes,
6
+ match_requests_on: [:host, :path]
7
+ } do
8
+ context 'results from daily schedule fetch' do
9
+ let(:games) do
10
+ SportsDataApi.set_access_level(:nhl, 't')
11
+ SportsDataApi.set_key(:nhl, api_key(:nhl))
12
+ SportsDataApi::Nhl.daily(2013, 12, 12)
13
+ end
14
+ subject { games }
15
+ it { should be_an_instance_of(SportsDataApi::Nhl::Games) }
16
+ its(:date) { should eq "2013-12-12" }
17
+ its(:count) { should eq 11 }
18
+ end
19
+ end
@@ -0,0 +1,56 @@
1
+ require 'spec_helper'
2
+
3
+ describe SportsDataApi::Nhl::Player, vcr: {
4
+ cassette_name: 'sports_data_api_nhl_player',
5
+ record: :new_episodes,
6
+ match_requests_on: [:host, :path]
7
+ } do
8
+ before do
9
+ SportsDataApi.set_key(:nhl, api_key(:nhl))
10
+ SportsDataApi.set_access_level(:nhl, 't')
11
+ end
12
+ let(:player) { SportsDataApi::Nhl.team_roster('441713b7-0f24-11e2-8525-18a905767e44').players.first.player }
13
+
14
+ describe 'player' do
15
+ subject { player }
16
+ it 'should have an id' do
17
+ expect(subject[:id]).to eql '42784f4b-0f24-11e2-8525-18a905767e44'
18
+ end
19
+
20
+ it 'should have a status' do
21
+ expect(subject[:status]).to eql 'ACT'
22
+ end
23
+
24
+ it 'should have a full_name' do
25
+ expect(subject[:full_name]).to eql 'George Parros'
26
+ end
27
+
28
+ it 'should have a first_name' do
29
+ expect(subject[:first_name]).to eql 'George'
30
+ end
31
+
32
+ it 'should have a last_name' do
33
+ expect(subject[:last_name]).to eql 'Parros'
34
+ end
35
+
36
+ it 'should have an abbr_name' do
37
+ expect(subject[:abbr_name]).to eql 'G.Parros'
38
+ end
39
+
40
+ it 'should have a handedness' do
41
+ expect(subject[:handedness]).to eql 'R'
42
+ end
43
+
44
+ it 'should have a position' do
45
+ expect(subject[:position]).to eql 'F'
46
+ end
47
+
48
+ it 'should have a primary_position' do
49
+ expect(subject[:primary_position]).to eql 'RW'
50
+ end
51
+
52
+ it 'should have a jersey_number' do
53
+ expect(subject[:jersey_number]).to eql '15'
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,41 @@
1
+ require 'spec_helper'
2
+
3
+ describe SportsDataApi::Nhl::Season, vcr: {
4
+ cassette_name: 'sports_data_api_nhl_season',
5
+ record: :new_episodes,
6
+ match_requests_on: [:host, :path]
7
+ } do
8
+ subject { SportsDataApi::Nhl::Season }
9
+ describe '.season?' do
10
+ context :PRE do
11
+ it { SportsDataApi::Nhl::Season.valid?(:PRE).should be_true }
12
+ end
13
+ context :REG do
14
+ it { subject.valid?(:REG).should be_true }
15
+ end
16
+ context :PST do
17
+ it { subject.valid?(:PST).should be_true }
18
+ end
19
+ context :pre do
20
+ it { subject.valid?(:pre).should be_false }
21
+ end
22
+ context :reg do
23
+ it { subject.valid?(:reg).should be_false }
24
+ end
25
+ context :pst do
26
+ it { subject.valid?(:pst).should be_false }
27
+ end
28
+ end
29
+ context 'results from schedule fetch' do
30
+ let(:season) do
31
+ SportsDataApi.set_access_level(:nhl, 't')
32
+ SportsDataApi.set_key(:nhl, api_key(:nhl))
33
+ SportsDataApi::Nhl.schedule(2013, :reg)
34
+ end
35
+ subject { season }
36
+ it { should be_an_instance_of(SportsDataApi::Nhl::Season) }
37
+ its(:year) { should eq 2013 }
38
+ its(:type) { should eq :REG }
39
+ its(:games) { should have(1233).games }
40
+ end
41
+ end
@@ -0,0 +1,240 @@
1
+ require 'spec_helper'
2
+
3
+ describe SportsDataApi::Nhl::Team, vcr: {
4
+ cassette_name: 'sports_data_api_nhl_team',
5
+ record: :new_episodes,
6
+ match_requests_on: [:host, :path]
7
+ } do
8
+ let(:teams) do
9
+ SportsDataApi.set_key(:nhl, api_key(:nhl))
10
+ SportsDataApi.set_access_level(:nhl, 't')
11
+ SportsDataApi::Nhl.teams
12
+ end
13
+ let(:roster) do
14
+ SportsDataApi.set_key(:nhl, api_key(:nhl))
15
+ SportsDataApi.set_access_level(:nhl, 't')
16
+ SportsDataApi::Nhl.team_roster('44151f7a-0f24-11e2-8525-18a905767e44')
17
+ end
18
+ let(:game_summary) do
19
+ SportsDataApi.set_key(:nhl, api_key(:nhl))
20
+ SportsDataApi.set_access_level(:nhl, 't')
21
+ SportsDataApi::Nhl.game_summary('f0f7e327-3a3a-410b-be75-0956c90c4988')
22
+ end
23
+
24
+ context 'results from teams fetch' do
25
+ subject { teams.first }
26
+ it { should be_an_instance_of(SportsDataApi::Nhl::Team) }
27
+ its(:id) { should eq "44151f7a-0f24-11e2-8525-18a905767e44" }
28
+ its(:alias) { should eq 'LA' }
29
+ its(:conference) { should eq 'WESTERN' }
30
+ its(:division) { should eq 'PACIFIC' }
31
+ its(:market) { should eq 'Los Angeles' }
32
+ its(:name) { should eq 'Kings' }
33
+ its(:players) { should eq [] }
34
+ its(:points) { should be_nil }
35
+ end
36
+ context 'results from team roster fetch' do
37
+ subject { roster }
38
+ it { should be_an_instance_of(SportsDataApi::Nhl::Team) }
39
+ its(:id) { should eq "44151f7a-0f24-11e2-8525-18a905767e44" }
40
+ its(:alias) { should eq 'LA' }
41
+ its(:market) { should eq 'Los Angeles' }
42
+ its(:name) { should eq 'Kings' }
43
+ its(:players) { should be_an_instance_of(Array) }
44
+ its(:points) { should be_nil }
45
+ context 'players' do
46
+ subject { roster.players }
47
+ its(:count) { should eq 27 }
48
+ end
49
+ end
50
+ context 'results from game_summary fetch' do
51
+ subject { game_summary.home_team }
52
+ it { should be_an_instance_of(SportsDataApi::Nhl::Team) }
53
+ its(:id) { should eq '441713b7-0f24-11e2-8525-18a905767e44' }
54
+ its(:market) { should eq 'Montreal' }
55
+ its(:name) { should eq 'Canadiens' }
56
+ its(:points) { should eq 3 }
57
+ its(:alias) { should be_nil }
58
+ its(:conference) { should be_nil }
59
+ its(:division) { should be_nil }
60
+ its(:players) { should be_an_instance_of(Array) }
61
+
62
+ context 'players' do
63
+ subject { game_summary.home_team.players }
64
+ its(:count) { should eq 26 }
65
+ end
66
+
67
+ context 'player' do
68
+ subject { game_summary.away_team.players.first }
69
+ it { should be_an_instance_of(SportsDataApi::Nhl::Player) }
70
+ it 'should have an id' do
71
+ expect(subject.player[:id]).to eq "42bf409e-0f24-11e2-8525-18a905767e44"
72
+ end
73
+ it 'should have a full_name' do
74
+ expect(subject.player[:full_name]).to eq "Dave Bolland"
75
+ end
76
+ it 'should have a first_name' do
77
+ expect(subject.player[:first_name]).to eq "Dave"
78
+ end
79
+ it 'should have a last_name' do
80
+ expect(subject.player[:last_name]).to eq "Bolland"
81
+ end
82
+ it 'should have a position' do
83
+ expect(subject.player[:position]).to eq "F"
84
+ end
85
+ it 'should have a primary_position' do
86
+ expect(subject.player[:primary_position]).to eq "C"
87
+ end
88
+ it 'should have a jersey_number' do
89
+ expect(subject.player[:jersey_number]).to eq "63"
90
+ end
91
+ it 'should have a played' do
92
+ expect(subject.player[:played]).to eq "true"
93
+ end
94
+ it 'should not be scratched' do
95
+ expect(subject.player[:scratched]).to eq nil
96
+ end
97
+ it 'should not have goaltending' do
98
+ expect(subject.stats.goaltending).to eql nil
99
+ end
100
+
101
+ its(:stats){ should be_an_instance_of(SportsDataApi::Stats) }
102
+ context 'stats' do
103
+ subject { game_summary.away_team.players.first.stats.statistics }
104
+ it 'should have goals' do
105
+ expect(subject[:goals]).to eql '0'
106
+ end
107
+ it 'should have assists' do
108
+ expect(subject[:assists]).to eql '0'
109
+ end
110
+ it 'should have penalties' do
111
+ expect(subject[:penalties]).to eql '1'
112
+ end
113
+ it 'should have penalty_minutes' do
114
+ expect(subject[:penalty_minutes]).to eql '2'
115
+ end
116
+ it 'should have shots' do
117
+ expect(subject[:shots]).to eql '2'
118
+ end
119
+ it 'should have blocked_att' do
120
+ expect(subject[:blocked_att]).to eql '1'
121
+ end
122
+ it 'should have missed_shots' do
123
+ expect(subject[:missed_shots]).to eql '1'
124
+ end
125
+ it 'should have hits' do
126
+ expect(subject[:hits]).to eql '4'
127
+ end
128
+ it 'should have blocked_att' do
129
+ expect(subject[:giveaways]).to eql '0'
130
+ end
131
+ it 'should have takeaways' do
132
+ expect(subject[:takeaways]).to eql '1'
133
+ end
134
+ it 'should have blocked_shots' do
135
+ expect(subject[:blocked_shots]).to eql '1'
136
+ end
137
+ it 'should have faceoffs_won' do
138
+ expect(subject[:faceoffs_won]).to eql '4'
139
+ end
140
+ it 'should have faceoffs_lost' do
141
+ expect(subject[:faceoffs_lost]).to eql '4'
142
+ end
143
+ it 'should have winning_goal' do
144
+ expect(subject[:winning_goal]).to eql 'false'
145
+ end
146
+ it 'should have shooting_pct' do
147
+ expect(subject[:shooting_pct]).to eql '0.0'
148
+ end
149
+ it 'should have faceoffs' do
150
+ expect(subject[:faceoffs]).to eql '8'
151
+ end
152
+ it 'should have faceoff_win_pct' do
153
+ expect(subject[:faceoff_win_pct]).to eql '50.0'
154
+ end
155
+ it 'should have points' do
156
+ expect(subject[:points]).to eql '0'
157
+ end
158
+ it 'should have powerplay_shots' do
159
+ expect(subject[:powerplay_shots]).to eql '0'
160
+ end
161
+ it 'should have powerplay_goals' do
162
+ expect(subject[:powerplay_goals]).to eql '0'
163
+ end
164
+ it 'should have powerplay_missed_shots' do
165
+ expect(subject[:powerplay_missed_shots]).to eql '0'
166
+ end
167
+ it 'should have powerplay_assists' do
168
+ expect(subject[:powerplay_assists]).to eql '0'
169
+ end
170
+ it 'should have shorthanded_shots' do
171
+ expect(subject[:shorthanded_shots]).to eql '0'
172
+ end
173
+ it 'should have shorthanded_goals' do
174
+ expect(subject[:shorthanded_goals]).to eql '0'
175
+ end
176
+ it 'should have shorthanded_missed_shots' do
177
+ expect(subject[:shorthanded_missed_shots]).to eql '0'
178
+ end
179
+ it 'should have shorthanded_assists' do
180
+ expect(subject[:shorthanded_assists]).to eql '0'
181
+ end
182
+ it 'should have eventstrength_shots' do
183
+ expect(subject[:evenstrength_shots]).to eql '2'
184
+ end
185
+ it 'should have eventstrength_goals' do
186
+ expect(subject[:evenstrength_goals]).to eql '0'
187
+ end
188
+ it 'should have eventstrength_missed_shots' do
189
+ expect(subject[:evenstrength_missed_shots]).to eql '1'
190
+ end
191
+ it 'should have eventstrength_assists' do
192
+ expect(subject[:evenstrength_assists]).to eql '0'
193
+ end
194
+ it 'should have penalty_shots' do
195
+ expect(subject[:penalty_shots]).to eql '0'
196
+ end
197
+ it 'should have penalty_goals' do
198
+ expect(subject[:penalty_goals]).to eql '0'
199
+ end
200
+ it 'should have penalty_missed_shots' do
201
+ expect(subject[:penalty_missed_shots]).to eql '0'
202
+ end
203
+ it 'should have shootout_shots' do
204
+ expect(subject[:shootout_shots]).to eql '0'
205
+ end
206
+ it 'should have shootout_goals' do
207
+ expect(subject[:shootout_goals]).to eql '0'
208
+ end
209
+ it 'should have shootout_missed_shots' do
210
+ expect(subject[:shootout_missed_shots]).to eql '0'
211
+ end
212
+ end
213
+ end
214
+
215
+ context 'goalie' do
216
+ subject { game_summary.away_team.players.select { |player| !player.stats.goaltending.nil? }.first.stats.goaltending }
217
+ it 'should have goaltending' do
218
+ expect(subject).to be_a Hash
219
+ end
220
+ it 'should have shots_against' do
221
+ expect(subject[:shots_against]).to eql '37'
222
+ end
223
+ it 'should have goals_against' do
224
+ expect(subject[:goals_against]).to eql '3'
225
+ end
226
+ it 'should have saves' do
227
+ expect(subject[:saves]).to eql '34'
228
+ end
229
+ it 'should have credit' do
230
+ expect(subject[:credit]).to eql 'win'
231
+ end
232
+ it 'should have shutout' do
233
+ expect(subject[:shutout]).to eql 'false'
234
+ end
235
+ it 'should have saves_pct' do
236
+ expect(subject[:saves_pct]).to eql '0.919'
237
+ end
238
+ end
239
+ end
240
+ end