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 +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/cineworld_uk/cinema.rb +6 -4
- data/lib/cineworld_uk/performance.rb +1 -0
- data/lib/cineworld_uk/version.rb +2 -2
- data/test/lib/cineworld_uk/cinema_test.rb +10 -0
- data/test/lib/cineworld_uk/performance_test.rb +32 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 487458108a3bd3d3c9c4c80662db1f9e1da34a3f
|
4
|
+
data.tar.gz: 2a314a2557cf8507863f7a316067f1b2131a9ab0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/cineworld_uk/cinema.rb
CHANGED
@@ -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
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
|
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)
|
data/lib/cineworld_uk/version.rb
CHANGED
@@ -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(
|
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
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
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
|
-
|
36
|
-
|
37
|
-
|
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.
|
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-
|
11
|
+
date: 2016-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|