sports_data_api 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -1
  3. data/lib/sports_data_api.rb +1 -0
  4. data/lib/sports_data_api/ncaafb.rb +84 -0
  5. data/lib/sports_data_api/ncaafb/broadcast.rb +14 -0
  6. data/lib/sports_data_api/ncaafb/division.rb +14 -0
  7. data/lib/sports_data_api/ncaafb/game.rb +78 -0
  8. data/lib/sports_data_api/ncaafb/games.rb +28 -0
  9. data/lib/sports_data_api/ncaafb/injuries.rb +9 -0
  10. data/lib/sports_data_api/ncaafb/player.rb +13 -0
  11. data/lib/sports_data_api/ncaafb/season.rb +25 -0
  12. data/lib/sports_data_api/ncaafb/team.rb +86 -0
  13. data/lib/sports_data_api/ncaafb/teams.rb +101 -0
  14. data/lib/sports_data_api/ncaafb/venue.rb +21 -0
  15. data/lib/sports_data_api/ncaafb/weather.rb +16 -0
  16. data/lib/sports_data_api/ncaafb/week.rb +18 -0
  17. data/lib/sports_data_api/version.rb +1 -1
  18. data/spec/cassettes/sports_data_api_ncaafb.yml +117 -0
  19. data/spec/cassettes/sports_data_api_ncaafb_broadcast.yml +1293 -0
  20. data/spec/cassettes/sports_data_api_ncaafb_game.yml +21491 -0
  21. data/spec/cassettes/sports_data_api_ncaafb_games.yml +1452 -0
  22. data/spec/cassettes/sports_data_api_ncaafb_season.yml +18150 -0
  23. data/spec/cassettes/sports_data_api_ncaafb_team.yml +884 -0
  24. data/spec/cassettes/sports_data_api_ncaafb_team_hierarchy.yml +1819 -0
  25. data/spec/cassettes/sports_data_api_ncaafb_venue.yml +1293 -0
  26. data/spec/cassettes/sports_data_api_ncaafb_weather.yml +1293 -0
  27. data/spec/cassettes/sports_data_api_nfl_week.yml +18148 -1
  28. data/spec/lib/sports_data_api/ncaafb/broadcast_spec.rb +19 -0
  29. data/spec/lib/sports_data_api/ncaafb/game_spec.rb +157 -0
  30. data/spec/lib/sports_data_api/ncaafb/games_spec.rb +21 -0
  31. data/spec/lib/sports_data_api/ncaafb/season_spec.rb +31 -0
  32. data/spec/lib/sports_data_api/ncaafb/team_spec.rb +74 -0
  33. data/spec/lib/sports_data_api/ncaafb/teams_spec.rb +76 -0
  34. data/spec/lib/sports_data_api/ncaafb/venue_spec.rb +27 -0
  35. data/spec/lib/sports_data_api/ncaafb/weather_spec.rb +21 -0
  36. data/spec/lib/sports_data_api/ncaafb/week_spec.rb +21 -0
  37. data/spec/lib/sports_data_api/ncaafb_spec.rb +42 -0
  38. data/spec/spec_helper.rb +2 -0
  39. data/sports_data_api.gemspec +1 -1
  40. metadata +56 -5
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ describe SportsDataApi::Ncaafb::Broadcast, vcr: {
4
+ cassette_name: 'sports_data_api_ncaafb_broadcast',
5
+ record: :new_episodes,
6
+ match_requests_on: [:host, :path]
7
+ } do
8
+ let(:weekly_schedule) do
9
+ SportsDataApi.set_access_level(:ncaafb, 't')
10
+ SportsDataApi.set_key(:ncaafb, api_key(:ncaafb))
11
+ SportsDataApi::Ncaafb.weekly(2014, :REG, 4)
12
+ end
13
+ context 'results from weekly schedule fetch' do
14
+ subject { weekly_schedule.first.broadcast }
15
+ its(:network) { should eq 'ESPN' }
16
+ its(:satellite) { should eq '206' }
17
+ its(:internet) { should eq 'WatchESPN' }
18
+ end
19
+ end
@@ -0,0 +1,157 @@
1
+ require 'spec_helper'
2
+
3
+ describe SportsDataApi::Ncaafb::Game, vcr: {
4
+ cassette_name: 'sports_data_api_ncaafb_game',
5
+ record: :new_episodes,
6
+ match_requests_on: [:host, :path]
7
+ } do
8
+ let(:season) do
9
+ SportsDataApi.set_key(:ncaafb, api_key(:ncaafb))
10
+ SportsDataApi.set_access_level(:ncaafb, 't')
11
+ SportsDataApi::Ncaafb.schedule(2014, :REG)
12
+ end
13
+
14
+ let(:boxscore) do
15
+ SportsDataApi.set_key(:ncaafb, api_key(:ncaafb))
16
+ SportsDataApi.set_access_level(:ncaafb, 't')
17
+ SportsDataApi::Ncaafb.boxscore(2014, :REG, 10, 'IOW', 'NW')
18
+ end
19
+
20
+ let(:game_statistics) do
21
+ SportsDataApi.set_key(:ncaafb, api_key(:ncaafb))
22
+ SportsDataApi.set_access_level(:ncaafb, 't')
23
+ SportsDataApi::Ncaafb.game_statistics(2014, :REG, 10, 'IOW', 'NW')
24
+ end
25
+ let(:weekly_schedule) do
26
+ SportsDataApi.set_access_level(:ncaafb, 't')
27
+ SportsDataApi.set_key(:ncaafb, api_key(:ncaafb))
28
+ SportsDataApi::Ncaafb.weekly(2014, :REG, 1)
29
+ end
30
+
31
+ context 'results from schedule fetch' do
32
+ subject { season.weeks.first.games.first }
33
+ it { should be_an_instance_of(SportsDataApi::Ncaafb::Game) }
34
+ its(:id) { should eq '92044ce9-3698-443d-88a9-47967462dd61' }
35
+ its(:scheduled) { should eq Time.new(2014, 8, 23, 19, 30, 00, '+00:00') }
36
+ its(:home) { should eq 'EW' }
37
+ its(:away) { should eq 'SHS' }
38
+ its(:status) { should eq 'closed' }
39
+ its(:home_team) { should be_an_instance_of(SportsDataApi::Ncaafb::Team) }
40
+ its(:away_team) { should be_an_instance_of(SportsDataApi::Ncaafb::Team) }
41
+ its(:venue) { should be_an_instance_of(SportsDataApi::Ncaafb::Venue) }
42
+ its(:broadcast) { should be_an_instance_of(SportsDataApi::Ncaafb::Broadcast) }
43
+ its(:weather) { should be_an_instance_of(SportsDataApi::Ncaafb::Weather) }
44
+ it '#summary' do
45
+ expect { subject.summary }.to raise_error(NotImplementedError)
46
+ end
47
+ it '#pbp' do
48
+ expect { subject.pbp }.to raise_error(NotImplementedError)
49
+ end
50
+ it '#roster' do
51
+ expect { subject.roster }.to raise_error(NotImplementedError)
52
+ end
53
+ it '#injuries' do
54
+ expect { subject.injuries }.to raise_error(NotImplementedError)
55
+ end
56
+ it '#depthchart' do
57
+ expect { subject.depthchart }.to raise_error(NotImplementedError)
58
+ end
59
+
60
+ its(:boxscore) { should be_an_instance_of(SportsDataApi::Ncaafb::Game) }
61
+ its(:statistics) { should be_an_instance_of(SportsDataApi::Ncaafb::Game) }
62
+ end
63
+
64
+ context 'results from boxscore fetch' do
65
+ subject { boxscore }
66
+ it { should be_an_instance_of(SportsDataApi::Ncaafb::Game) }
67
+ its(:id) { should eq 'f38cb305-28e8-446e-ac4a-c36fe7f823ea' }
68
+ its(:scheduled) { should eq Time.new(2014, 11, 1, 16, 00, 00, '+00:00') }
69
+ its(:home) { should eq 'IOW' }
70
+ its(:away) { should eq 'NW' }
71
+ its(:status) { should eq 'closed' }
72
+ its(:quarter) { should eq 4 }
73
+ its(:clock) { should eq ':00' }
74
+ its(:home_team) { should be_an_instance_of(SportsDataApi::Ncaafb::Team) }
75
+ its(:away_team) { should be_an_instance_of(SportsDataApi::Ncaafb::Team) }
76
+ its(:venue) { should be_an_instance_of(SportsDataApi::Ncaafb::Venue) }
77
+ its(:broadcast) { should be_an_instance_of(SportsDataApi::Ncaafb::Broadcast) }
78
+ its(:weather) { should be_an_instance_of(SportsDataApi::Ncaafb::Weather) }
79
+ it '#summary' do
80
+ expect { subject.summary }.to raise_error(NotImplementedError)
81
+ end
82
+ it '#pbp' do
83
+ expect { subject.pbp }.to raise_error(NotImplementedError)
84
+ end
85
+ it '#roster' do
86
+ expect { subject.roster }.to raise_error(NotImplementedError)
87
+ end
88
+ it '#injuries' do
89
+ expect { subject.injuries }.to raise_error(NotImplementedError)
90
+ end
91
+ it '#depthchart' do
92
+ expect { subject.depthchart }.to raise_error(NotImplementedError)
93
+ end
94
+
95
+ its(:boxscore) { should be_an_instance_of(SportsDataApi::Ncaafb::Game)}
96
+ its(:statistics) { should be_an_instance_of(SportsDataApi::Ncaafb::Game) }
97
+ end
98
+
99
+ context 'results from weekly schedule fetch' do
100
+ subject { weekly_schedule.first }
101
+ it { should be_an_instance_of(SportsDataApi::Ncaafb::Game) }
102
+ its(:id) { should eq '92044ce9-3698-443d-88a9-47967462dd61' }
103
+ its(:scheduled) { should eq Time.new(2014, 8, 23, 19, 30, 00, '+00:00') }
104
+ its(:home) { should eq 'EW' }
105
+ its(:away) { should eq 'SHS' }
106
+ its(:status) { should eq 'closed' }
107
+ its(:quarter) { should eq 0 }
108
+ its(:clock) { should eq nil }
109
+ its(:home_team) { should be_an_instance_of(SportsDataApi::Ncaafb::Team) }
110
+ its(:away_team) { should be_an_instance_of(SportsDataApi::Ncaafb::Team) }
111
+ its(:venue) { should be_an_instance_of(SportsDataApi::Ncaafb::Venue) }
112
+ its(:broadcast) { should be_an_instance_of(SportsDataApi::Ncaafb::Broadcast) }
113
+ its(:weather) { should be_an_instance_of(SportsDataApi::Ncaafb::Weather) }
114
+ it '#summary' do
115
+ expect { subject.summary }.to raise_error(NotImplementedError)
116
+ end
117
+ it '#pbp' do
118
+ expect { subject.pbp }.to raise_error(NotImplementedError)
119
+ end
120
+ it '#roster' do
121
+ expect { subject.roster }.to raise_error(NotImplementedError)
122
+ end
123
+ it '#injuries' do
124
+ expect { subject.injuries }.to raise_error(NotImplementedError)
125
+ end
126
+ it '#depthchart' do
127
+ expect { subject.depthchart }.to raise_error(NotImplementedError)
128
+ end
129
+ its(:boxscore) { should be_an_instance_of(SportsDataApi::Ncaafb::Game) }
130
+ its(:statistics) { should be_an_instance_of(SportsDataApi::Ncaafb::Game) }
131
+ end
132
+ context 'results from game statistics fetch' do
133
+ subject { game_statistics }
134
+ its(:id) { should eq 'f38cb305-28e8-446e-ac4a-c36fe7f823ea' }
135
+ its(:status) { should eq 'closed' }
136
+ its(:scheduled) { should eq Time.new(2014, 11, 01, 16, 00, 00, '+00:00') }
137
+ its(:home_team) { should be_an_instance_of(SportsDataApi::Ncaafb::Team) }
138
+ its(:away_team) { should be_an_instance_of(SportsDataApi::Ncaafb::Team) }
139
+
140
+ it '#summary' do
141
+ expect { subject.summary }.to raise_error(NotImplementedError)
142
+ end
143
+ it '#pbp' do
144
+ expect { subject.pbp }.to raise_error(NotImplementedError)
145
+ end
146
+ it '#roster' do
147
+ expect { subject.roster }.to raise_error(NotImplementedError)
148
+ end
149
+ it '#injuries' do
150
+ expect { subject.injuries }.to raise_error(NotImplementedError)
151
+ end
152
+ it '#depthchart' do
153
+ expect { subject.depthchart }.to raise_error(NotImplementedError)
154
+ end
155
+ its(:boxscore) { should be_an_instance_of(SportsDataApi::Ncaafb::Game) }
156
+ end
157
+ end
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+
3
+ describe SportsDataApi::Ncaafb::Games, vcr: {
4
+ cassette_name: 'sports_data_api_ncaafb_games',
5
+ record: :new_episodes,
6
+ match_requests_on: [:host, :path]
7
+ } do
8
+ context 'results from weekly schedule fetch' do
9
+ let(:games) do
10
+ SportsDataApi.set_access_level(:ncaafb, 't')
11
+ SportsDataApi.set_key(:ncaafb, api_key(:ncaafb))
12
+ SportsDataApi::Ncaafb.weekly(2014, :REG, 1)
13
+ end
14
+ subject { games }
15
+ it { should be_an_instance_of(SportsDataApi::Ncaafb::Games) }
16
+ its(:year) { should eq 2014 }
17
+ its(:season) { should eq :REG }
18
+ its(:week) { should eq 1 }
19
+ its(:count) { should eq 123 }
20
+ end
21
+ end
@@ -0,0 +1,31 @@
1
+ require 'spec_helper'
2
+
3
+ describe SportsDataApi::Ncaafb::Season, vcr: {
4
+ cassette_name: 'sports_data_api_ncaafb_season',
5
+ record: :new_episodes,
6
+ match_requests_on: [:host, :path]
7
+ } do
8
+ subject { SportsDataApi::Ncaafb::Season }
9
+ describe '.season?' do
10
+
11
+ context :REG do
12
+ it { subject.valid?(:REG).should be_true }
13
+ end
14
+ context :reg do
15
+ it { subject.valid?(:reg).should be_false }
16
+ end
17
+ end
18
+
19
+ context 'results from schedule fetch' do
20
+ let(:season) do
21
+ SportsDataApi.set_access_level(:ncaafb, 't')
22
+ SportsDataApi.set_key(:ncaafb, api_key(:ncaafb))
23
+ SportsDataApi::Ncaafb.schedule(2014, :REG)
24
+ end
25
+ subject { season }
26
+ it { should be_an_instance_of(SportsDataApi::Ncaafb::Season) }
27
+ its(:year) { should eq 2014 }
28
+ its(:type) { should eq :REG }
29
+ its(:weeks) { should have(21).weeks }
30
+ end
31
+ end
@@ -0,0 +1,74 @@
1
+ require 'spec_helper'
2
+
3
+ describe SportsDataApi::Ncaafb::Team, vcr: {
4
+ cassette_name: 'sports_data_api_ncaafb_team',
5
+ record: :new_episodes,
6
+ match_requests_on: [:host, :path]
7
+ } do
8
+ let(:boxscore) do
9
+ SportsDataApi.set_key(:ncaafb, api_key(:ncaafb))
10
+ SportsDataApi.set_access_level(:ncaafb, 't')
11
+ SportsDataApi::Ncaafb.boxscore(2014, :REG, 10, 'IOW', 'NW')
12
+ end
13
+ let(:game_statistics) do
14
+ SportsDataApi.set_key(:ncaafb, api_key(:ncaafb))
15
+ SportsDataApi.set_access_level(:ncaafb, 't')
16
+ SportsDataApi::Ncaafb.game_statistics(2014, :REG, 10, 'IOW', 'NW')
17
+ end
18
+
19
+ context 'boxscore' do
20
+ describe 'home team' do
21
+ subject { boxscore.home_team }
22
+ it { should be_an_instance_of(SportsDataApi::Ncaafb::Team) }
23
+ its(:id) { should eq 'IOW' }
24
+ its(:name) { should eq 'Hawkeyes' }
25
+ its(:market) { should eq 'Iowa' }
26
+ its(:remaining_challenges) { should eq 2 }
27
+ its(:remaining_timeouts) { should eq 2 }
28
+ its(:score) { should eq 48 }
29
+ its(:quarters) { should have(4).scores }
30
+ its(:quarters) { should eq [24, 14, 0, 10] }
31
+ end
32
+
33
+ describe 'away team' do
34
+ subject { boxscore.away_team }
35
+ it { should be_an_instance_of(SportsDataApi::Ncaafb::Team) }
36
+ its(:id) { should eq 'NW' }
37
+ its(:name) { should eq 'Wildcats' }
38
+ its(:market) { should eq 'Northwestern' }
39
+ its(:remaining_challenges) { should eq 2 }
40
+ its(:remaining_timeouts) { should eq 2 }
41
+ its(:score) { should eq 7 }
42
+ its(:quarters) { should have(4).scores }
43
+ its(:quarters) { should eq [0, 7, 0, 0] }
44
+ end
45
+
46
+ describe 'eql' do
47
+ let(:url) { 'http://api.sportsdatallc.org/ncaafb-t1/teams/uscaa/hierarchy.json' }
48
+
49
+ let(:team_hash) do
50
+ str = RestClient.get(url, params: { api_key: api_key(:ncaafb) }).to_s
51
+ teams_hash = MultiJson.load(str)
52
+ teams_hash['conferences'][0]['teams'][0]
53
+ end
54
+
55
+ let(:team_1) { SportsDataApi::Ncaafb::Team.new(team_hash) }
56
+ let(:team_2) { SportsDataApi::Ncaafb::Team.new(team_hash) }
57
+
58
+ it { (team_1 == team_2).should be_true }
59
+ end
60
+ end
61
+
62
+ context 'game statistics' do
63
+ describe 'home team' do
64
+ subject { game_statistics.home_team }
65
+ its(:id) { should eq 'IOW' }
66
+ its(:points) { should eq 48 }
67
+ end
68
+ describe 'away team' do
69
+ subject { game_statistics.away_team }
70
+ its(:id) { should eq 'NW' }
71
+ its(:points) { should eq 7 }
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,76 @@
1
+ require 'spec_helper'
2
+
3
+ describe SportsDataApi::Ncaafb::Teams, vcr: {
4
+ cassette_name: 'sports_data_api_ncaafb_team_hierarchy',
5
+ record: :new_episodes,
6
+ match_requests_on: [:host, :path]
7
+ } do
8
+
9
+ let(:teams) do
10
+ SportsDataApi.set_key(:ncaafb, api_key(:ncaafb))
11
+ SportsDataApi.set_access_level(:ncaafb, 't')
12
+ SportsDataApi::Ncaafb.teams(:FBS)
13
+ end
14
+
15
+ let(:url) { 'http://api.sportsdatallc.org/ncaafb-t1/teams/fbs/hierarchy.json' }
16
+ let(:subdivisions_list) { [:"ACC-ATLANTIC", :"ACC-COASTAL", :"AAC-EAST", :"AAC-WEST", :"BIG-TEN-EAST", :"BIG-TEN-WEST", :"CONFERENCE-USA-EAST", :"CONFERENCE-USA-WEST", :"MID-AMERICAN-EAST", :"MID-AMERICAN-WEST", :"MOUNTAIN-WEST-MOUNTAIN", :"MOUNTAIN-WEST-WEST", :"PAC-12-SOUTH", :"PAC-12-NORTH", :"SEC-WEST", :"SEC-EAST"] }
17
+ let(:divisions_list) { [:"FBS"] }
18
+ let(:louisville_hash) do
19
+ str = RestClient.get(url, params: { api_key: api_key(:ncaafb) }).to_s
20
+ teams_hash = MultiJson.load(str)
21
+ teams_hash['conferences'][0]['subdivisions'][0]['teams'][0]
22
+ end
23
+
24
+ let(:louisville) { SportsDataApi::Ncaafb::Team.new(louisville_hash) }
25
+
26
+ subject { teams }
27
+ its(:conferences) { should eq([:ACC, :AAC, :"BIG-12", :"BIG-TEN", :"CONFERENCE-USA", :"IA-INDEPENDENTS", :"MID-AMERICAN", :"MOUNTAIN-WEST", :"PAC-12", :SEC, :"SUN-BELT"]) }
28
+
29
+ its(:subdivisions) { should eq(subdivisions_list.map { |str| str.to_sym })}
30
+ its(:divisions) { should eq(divisions_list) }
31
+
32
+ its(:count) { should eq 129 }
33
+
34
+ it { subject[:LOU].should eq louisville }
35
+
36
+ describe 'meta methods' do
37
+ it { should respond_to :FBS }
38
+ it { should respond_to :fbs }
39
+
40
+ its(:FBS) { should be_a Array }
41
+ its(:fbs) { should be_a Array }
42
+ its(:ACC) { should be_a Array }
43
+ its(:aac) { should be_a Array }
44
+
45
+ describe '#method_missing' do
46
+ it 'raise error' do
47
+ expect{subject.unknow_division}.to raise_error(NoMethodError)
48
+ end
49
+ end
50
+
51
+ describe '#ACC' do
52
+ context "upcase" do
53
+ subject { teams.ACC }
54
+ its(:count) { should eq 14 }
55
+ end
56
+
57
+ context "downcase" do
58
+ subject { teams.acc }
59
+ its(:count) { should eq 14 }
60
+ end
61
+ end
62
+
63
+ describe '#FBS' do
64
+ context "upcase" do
65
+ subject { teams.FBS }
66
+ its(:count) { should eq 105 }
67
+ end
68
+
69
+ context "downcase" do
70
+ subject { teams.fbs }
71
+ its(:count) { should eq 105 }
72
+ end
73
+ end
74
+ end
75
+ end
76
+
@@ -0,0 +1,27 @@
1
+ require 'spec_helper'
2
+
3
+ describe SportsDataApi::Ncaafb::Venue, vcr: {
4
+ cassette_name: 'sports_data_api_ncaafb_venue',
5
+ record: :new_episodes,
6
+ match_requests_on: [:host, :path]
7
+ } do
8
+ let(:weekly_schedule) do
9
+ SportsDataApi.set_access_level(:ncaafb, 't')
10
+ SportsDataApi.set_key(:ncaafb, api_key(:ncaafb))
11
+ SportsDataApi::Ncaafb.weekly(2014, :REG, 4)
12
+ end
13
+
14
+ context 'results from weekly schedule fetch' do
15
+ subject { weekly_schedule.first.venue }
16
+ its(:id) { should eq 'c63bd111-d94a-42e1-bd95-cbb74103552c' }
17
+ its(:name) { should eq 'Bill Snyder Family Football Stadium' }
18
+ its(:address) { should eq '1800 College Avenue' }
19
+ its(:city) { should eq 'Manhattan' }
20
+ its(:state) { should eq 'KS' }
21
+ its(:zip) { '46225' }
22
+ its(:country) { should eq 'USA' }
23
+ its(:capacity) { should eq 50000 }
24
+ its(:surface) { should eq 'artificial' }
25
+ its(:type) { should eq 'outdoor' }
26
+ end
27
+ end
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+
3
+ describe SportsDataApi::Ncaafb::Weather, vcr: {
4
+ cassette_name: 'sports_data_api_ncaafb_weather',
5
+ record: :new_episodes,
6
+ match_requests_on: [:host, :path]
7
+ } do
8
+ let(:weekly_schedule) do
9
+ SportsDataApi.set_access_level(:ncaafb, 't')
10
+ SportsDataApi.set_key(:ncaafb, api_key(:ncaafb))
11
+ SportsDataApi::Ncaafb.weekly(2014, :REG, 4)
12
+ end
13
+ context 'results from weekly schedule fetch' do
14
+ subject { weekly_schedule.first.weather }
15
+ its(:temperature) { should eq 79 }
16
+ its(:condition) { should eq 'Sunny' }
17
+ its(:humidity) { should eq 65 }
18
+ its(:wind_speed) { should eq 9 }
19
+ its(:wind_direction) { should eq 'ENE' }
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+
3
+ describe SportsDataApi::Ncaafb::Week, vcr: {
4
+ cassette_name: 'sports_data_api_nfl_week',
5
+ record: :new_episodes,
6
+ match_requests_on: [:host, :path]
7
+ } do
8
+ context 'results from schedule fetch' do
9
+ let(:season) do
10
+ SportsDataApi.set_access_level(:ncaafb, 't')
11
+ SportsDataApi.set_key(:ncaafb, api_key(:ncaafb))
12
+ SportsDataApi::Ncaafb.schedule(2014, :REG)
13
+ end
14
+ subject { season.weeks.first }
15
+ it { should be_an_instance_of(SportsDataApi::Ncaafb::Week) }
16
+ its(:year) { should eq 2014 }
17
+ its(:season) { should eq :REG }
18
+ its(:number) { should eq 1 }
19
+ its(:games) { should have(123).games }
20
+ end
21
+ end