cineworld_uk 3.0.2 → 3.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ebbf1f918885187d0b5018962df36b462f28a0b4
4
- data.tar.gz: c543d3705fef10efaf8040ff46df581472a10b78
3
+ metadata.gz: 487458108a3bd3d3c9c4c80662db1f9e1da34a3f
4
+ data.tar.gz: 2a314a2557cf8507863f7a316067f1b2131a9ab0
5
5
  SHA512:
6
- metadata.gz: fccdbaef9c63ddd2c87a76bdef0f3f3994f964aa806c2054029a823e994adad0199d01e43f60d5022c5f08428390cfc95592305ca4ed9cb97b6ac7c2d848a4aa
7
- data.tar.gz: 35f472840f1c329e871b71b2c41483b7ace212ea8c44f63ee4d7e2627d37fe655fb30145bc9e52840fff04ac4cfbe16929e6af2214ec6a84cc0f092823bcde3b
6
+ metadata.gz: c322a658ed67ab7b87226bddca7330da2cb87109c3b45cd3b998af747e7ed650053d7ff7d033a510439af5f86fea6607701d7453334278dd315e8682ad4e9a02
7
+ data.tar.gz: 69b3c6a0aaf283904e613142eea47e89db02b2c4cea1014ca536c9065d627aafab44051d5bd8b19bfc45f1c70dbd4261c1aaa5b7602dc995f96d8f034185a749
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+ ## 3.0.3 - 2016-02-10
6
+
7
+ ### Changed
8
+ - Performance.at uses a Fixnum internally
9
+
5
10
  ## 3.0.2 - 2016-02-09
6
11
 
7
12
  ### Added
@@ -4,10 +4,12 @@ module CineworldUk
4
4
  # @!attribute [r] id
5
5
  # @return [Integer] the numeric id of the cinema on the Cineworld website
6
6
 
7
- # @!method initialize(id)
8
- # Constructor
9
- # @param [Integer, String] id cinema id
10
- # @return [CineworldUk::Cinema]
7
+ # Constructor
8
+ # @param [Integer, String] id cinema id
9
+ # @return [CineworldUk::Cinema]
10
+ def initialize(id)
11
+ @id = id.to_i
12
+ end
11
13
 
12
14
  # Return basic cinema information for all cinemas
13
15
  # @return [Array<CineworldUk::Cinema>]
@@ -26,6 +26,7 @@ module CineworldUk
26
26
  # @param [Integer] cinema_id id of the cinema on the website
27
27
  # @return [Array<CineworldUk::Screening>]
28
28
  def self.at(cinema_id)
29
+ cinema_id = cinema_id.to_i
29
30
  dates(cinema_id).flat_map do |date|
30
31
  performances_on(cinema_id, date).flat_map do |p|
31
32
  new cinema_hash(cinema_id).merge(p)
@@ -1,6 +1,6 @@
1
1
  # Ruby interface for http://www.cineworld.co.uk
2
- # @version 3.0.2
2
+ # @version 3.0.3
3
3
  module CineworldUk
4
4
  # Gem version
5
- VERSION = '3.0.2'.freeze
5
+ VERSION = '3.0.3'.freeze
6
6
  end
@@ -114,6 +114,16 @@ describe CineworldUk::Cinema do
114
114
  end
115
115
  end
116
116
 
117
+ describe 'simple name (Brighton) called with String' do
118
+ let(:id) { '3' }
119
+
120
+ it 'returns the brand in the name' do
121
+ CineworldUk::Internal::ApiResponse.stub :new, api_response do
122
+ subject.must_equal 'Cineworld Brighton'
123
+ end
124
+ end
125
+ end
126
+
117
127
  describe 'complex name (Glasgow IMAX)' do
118
128
  let(:id) { 88 }
119
129
 
@@ -11,7 +11,7 @@ describe CineworldUk::Performance do
11
11
  after { WebMock.allow_net_connect! }
12
12
 
13
13
  describe '.at(cinema_id)' do
14
- subject { described_class.at(3) }
14
+ subject { described_class.at(cinema_id) }
15
15
 
16
16
  before do
17
17
  api_response.expect(:cinema_list, cinema_list_json)
@@ -23,18 +23,41 @@ describe CineworldUk::Performance do
23
23
  [3, Date.today + 1])
24
24
  end
25
25
 
26
- it 'returns an array of performances' do
27
- CineworldUk::Internal::ApiResponse.stub :new, api_response do
28
- subject.must_be_instance_of(Array)
29
- subject.each do |performance|
30
- performance.must_be_instance_of(described_class)
26
+ describe 'called with integer' do
27
+ let(:cinema_id) { 3 }
28
+
29
+ it 'returns an array of performances' do
30
+ CineworldUk::Internal::ApiResponse.stub :new, api_response do
31
+ subject.must_be_instance_of(Array)
32
+ subject.each do |performance|
33
+ performance.must_be_instance_of(described_class)
34
+ end
35
+ end
36
+ end
37
+
38
+ it 'returns at least a sensible number' do
39
+ CineworldUk::Internal::ApiResponse.stub :new, api_response do
40
+ subject.count.must_be :>, 5
31
41
  end
32
42
  end
33
43
  end
34
44
 
35
- it 'returns at least a sensible number' do
36
- CineworldUk::Internal::ApiResponse.stub :new, api_response do
37
- subject.count.must_be :>, 5
45
+ describe 'called with string' do
46
+ let(:cinema_id) { '3' }
47
+
48
+ it 'returns an array of performances' do
49
+ CineworldUk::Internal::ApiResponse.stub :new, api_response do
50
+ subject.must_be_instance_of(Array)
51
+ subject.each do |performance|
52
+ performance.must_be_instance_of(described_class)
53
+ end
54
+ end
55
+ end
56
+
57
+ it 'returns at least a sensible number' do
58
+ CineworldUk::Internal::ApiResponse.stub :new, api_response do
59
+ subject.count.must_be :>, 5
60
+ end
38
61
  end
39
62
  end
40
63
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cineworld_uk
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Croll
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-09 00:00:00.000000000 Z
11
+ date: 2016-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler