picturehouse_uk 3.0.13 → 3.0.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,7 +16,7 @@ describe PicturehouseUk::Film do
16
16
  subject { described_class.at('Duke_Of_Yorks') }
17
17
 
18
18
  before do
19
- website.expect(:cinema, cinema_html('Duke_Of_Yorks'), ['Duke_Of_Yorks'])
19
+ website.expect(:whats_on, whats_on_html('Duke_Of_Yorks'), ['Duke_Of_Yorks'])
20
20
  end
21
21
 
22
22
  it 'returns an array of films' do
@@ -131,8 +131,8 @@ describe PicturehouseUk::Film do
131
131
 
132
132
  private
133
133
 
134
- def cinema_html(filename)
135
- read_file("../../../fixtures/cinema/#{filename}.html")
134
+ def whats_on_html(filename)
135
+ read_file("../../../fixtures/whats_on/#{filename}.html")
136
136
  end
137
137
 
138
138
  def read_file(filepath)
@@ -13,7 +13,7 @@ describe PicturehouseUk::Internal::Parser::Screenings do
13
13
  describe "#{cinema}: #to_a" do
14
14
  subject { described_class.new(cinema).to_a }
15
15
 
16
- before { website.expect(:cinema, html(cinema), [cinema]) }
16
+ before { website.expect(:whats_on, html(cinema), [cinema]) }
17
17
 
18
18
  it 'returns an non-zero array of hashes' do
19
19
  PicturehouseUk::Internal::Website.stub :new, website do
@@ -46,7 +46,7 @@ describe PicturehouseUk::Internal::Parser::Screenings do
46
46
  describe "#{cinema}: #to_a" do
47
47
  subject { described_class.new(cinema).to_a }
48
48
 
49
- before { website.expect(:cinema, html(cinema), [cinema]) }
49
+ before { website.expect(:whats_on, html(cinema), [cinema]) }
50
50
 
51
51
  it 'returns an non-zero array of hashes with imax variants' do
52
52
  PicturehouseUk::Internal::Website.stub :new, website do
@@ -67,6 +67,6 @@ describe PicturehouseUk::Internal::Parser::Screenings do
67
67
  end
68
68
 
69
69
  def html(cinema)
70
- read_file("../../../../../fixtures/cinema/#{cinema}.html")
70
+ read_file("../../../../../fixtures/whats_on/#{cinema}.html")
71
71
  end
72
72
  end
@@ -13,6 +13,16 @@ describe PicturehouseUk::Internal::Website do
13
13
  end
14
14
  end
15
15
 
16
+ describe '#home' do
17
+ subject { described_class.new.home }
18
+
19
+ before { stub_get('', home_html) }
20
+
21
+ it 'returns a string' do
22
+ subject.class.must_equal String
23
+ end
24
+ end
25
+
16
26
  describe '#info(id)' do
17
27
  subject { described_class.new.info('Duke_Of_Yorks') }
18
28
 
@@ -28,10 +38,15 @@ describe PicturehouseUk::Internal::Website do
28
38
  end
29
39
  end
30
40
 
31
- describe '#home' do
32
- subject { described_class.new.home }
41
+ describe '#whats_on(id)' do
42
+ subject { described_class.new.whats_on('Duke_Of_Yorks') }
33
43
 
34
- before { stub_get('', home_html) }
44
+ before do
45
+ stub_get(
46
+ 'cinema/Duke_Of_Yorks/Whats_On',
47
+ duke_of_yorks_whats_on_html
48
+ )
49
+ end
35
50
 
36
51
  it 'returns a string' do
37
52
  subject.class.must_equal String
@@ -48,6 +63,10 @@ describe PicturehouseUk::Internal::Website do
48
63
  read_file('../../../../fixtures/info/Duke_Of_Yorks.html')
49
64
  end
50
65
 
66
+ def duke_of_yorks_whats_on_html
67
+ read_file('../../../../fixtures/whats_on/Duke_Of_Yorks.html')
68
+ end
69
+
51
70
  def home_html
52
71
  read_file('../../../../fixtures/home.html')
53
72
  end
@@ -19,7 +19,7 @@ describe PicturehouseUk::Screening do
19
19
 
20
20
  it 'returns correct number of screenings' do
21
21
  PicturehouseUk::Internal::Website.stub :new, website do
22
- subject.count.must_equal 59
22
+ subject.count.must_equal 58
23
23
  end
24
24
  end
25
25
 
@@ -168,6 +168,10 @@ describe PicturehouseUk::Screening do
168
168
  read_file("../../../fixtures/contact_us/#{filename}.html")
169
169
  end
170
170
 
171
+ def whats_on(filename)
172
+ read_file("../../../fixtures/whats_on/#{filename}.html")
173
+ end
174
+
171
175
  private
172
176
 
173
177
  def read_file(filepath)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: picturehouse_uk
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.13
4
+ version: 3.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Croll
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-06 00:00:00.000000000 Z
11
+ date: 2015-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -143,6 +143,10 @@ files:
143
143
  - test/fixtures/info/Duke_Of_Yorks.html
144
144
  - test/fixtures/info/Dukes_At_Komedia.html
145
145
  - test/fixtures/info/Phoenix_Picturehouse.html
146
+ - test/fixtures/whats_on/Duke_Of_Yorks.html
147
+ - test/fixtures/whats_on/Dukes_At_Komedia.html
148
+ - test/fixtures/whats_on/National_Media_Museum.html
149
+ - test/fixtures/whats_on/Phoenix_Picturehouse.html
146
150
  - test/lib/picturehouse_uk/cinema_test.rb
147
151
  - test/lib/picturehouse_uk/film_test.rb
148
152
  - test/lib/picturehouse_uk/internal/parser/address_parser_test.rb
@@ -187,6 +191,10 @@ test_files:
187
191
  - test/fixtures/info/Duke_Of_Yorks.html
188
192
  - test/fixtures/info/Dukes_At_Komedia.html
189
193
  - test/fixtures/info/Phoenix_Picturehouse.html
194
+ - test/fixtures/whats_on/Duke_Of_Yorks.html
195
+ - test/fixtures/whats_on/Dukes_At_Komedia.html
196
+ - test/fixtures/whats_on/National_Media_Museum.html
197
+ - test/fixtures/whats_on/Phoenix_Picturehouse.html
190
198
  - test/lib/picturehouse_uk/cinema_test.rb
191
199
  - test/lib/picturehouse_uk/film_test.rb
192
200
  - test/lib/picturehouse_uk/internal/parser/address_parser_test.rb