swr3-nowplaying 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/Rakefile +7 -2
- data/lib/swr3_now_playing/loader.rb +1 -1
- data/lib/swr3_now_playing/version.rb +1 -1
- data/test/fixtures/vcr/IntegrationTest_setup.yml +29 -180
- data/test/integration/test_all.rb +8 -5
- data/test/system/test_all.rb +28 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ed5598a61317b28d773401e93ce8ef692733c80
|
4
|
+
data.tar.gz: 17cf8d7350e31ed4d81f282e018de573841f47f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ef5c27884a432b4342e0613483b2b560315ec9b0a812ed00cd106220f72a931656dd2b09b1fac65c41e0f3f2c1d4ad48d6c8e240cd5c5b0149237d379aa34f0
|
7
|
+
data.tar.gz: 03b08cfb66adb672a2874c1cde6792e24b85744a831854bdf90f8c53e821c1ebc5c872471373223a3bc111436c799bd14cffafa0c6e1b2c8047e05294fd606eb
|
data/.travis.yml
CHANGED
data/Rakefile
CHANGED
@@ -5,10 +5,10 @@ require 'rake/testtask'
|
|
5
5
|
|
6
6
|
namespace :test do
|
7
7
|
desc 'Run all specs'
|
8
|
-
task all: ['rubocop:auto_correct', :unit, :integration]
|
8
|
+
task all: ['rubocop:auto_correct', :unit, :integration, :system]
|
9
9
|
|
10
10
|
desc 'Run ci'
|
11
|
-
task ci: [:rubocop, :unit, :integration]
|
11
|
+
task ci: [:rubocop, :unit, :integration, :system]
|
12
12
|
|
13
13
|
Rake::TestTask.new('unit') do |test|
|
14
14
|
test.libs << 'lib' << 'test' << 'test/unit'
|
@@ -19,6 +19,11 @@ namespace :test do
|
|
19
19
|
test.libs << 'lib' << 'test'
|
20
20
|
test.pattern = 'test/integration/test_*.rb'
|
21
21
|
end
|
22
|
+
|
23
|
+
Rake::TestTask.new('system') do |test|
|
24
|
+
test.libs << 'lib' << 'test'
|
25
|
+
test.pattern = 'test/system/test_*.rb'
|
26
|
+
end
|
22
27
|
end
|
23
28
|
|
24
29
|
RuboCop::RakeTask.new
|
@@ -2,171 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri:
|
6
|
-
body:
|
7
|
-
encoding: US-ASCII
|
8
|
-
string: ''
|
9
|
-
headers:
|
10
|
-
Accept:
|
11
|
-
- "*/*"
|
12
|
-
User-Agent:
|
13
|
-
- Ruby
|
14
|
-
response:
|
15
|
-
status:
|
16
|
-
code: 200
|
17
|
-
message: OK
|
18
|
-
headers:
|
19
|
-
Server:
|
20
|
-
- Apache-Coyote/1.1
|
21
|
-
Content-Type:
|
22
|
-
- application/json;charset=utf-8
|
23
|
-
Cache-Control:
|
24
|
-
- max-age=13
|
25
|
-
Expires:
|
26
|
-
- Sat, 02 Feb 2013 19:16:15 GMT
|
27
|
-
Date:
|
28
|
-
- Sat, 02 Feb 2013 19:16:02 GMT
|
29
|
-
Content-Length:
|
30
|
-
- '1584'
|
31
|
-
Connection:
|
32
|
-
- keep-alive
|
33
|
-
body:
|
34
|
-
encoding: US-ASCII
|
35
|
-
string: "{ \"detail\": {\n \"@id\": \"202234\",\n \"leadText\": null,\n \"text\":
|
36
|
-
null,\n \"topline\": \"SWR3 Musikrecherche\",\n \"title\": \"Die letzten
|
37
|
-
13 Titel auf SWR3\",\n \"detailImages\": [\n ]}, \"frontmod\": [{ \"title\"
|
38
|
-
: \"Red flag\"\n , \"externalId\" : \"williams_title13552\"\n ,
|
39
|
-
\"cover\" : { \"@id\": \"211180\",\n \"alt\": \"CD-Cover Billy Talent -
|
40
|
-
Red flag\",\n \"subline\": \"CD-Cover: Billy Talent - Red flag\",\n \"copyright\":
|
41
|
-
\"SWR3.de\"\n ,\"detail\": { \"src\": \"http://www.swr3.de/-/id=211180/property=detail/width=200/height=174/pubVersion=15/18p3xn3/index.jpg\",\n
|
42
|
-
\ \"width\": 200,\n \"height\": 174}\n
|
43
|
-
\ \n ,\"small\": { \"src\": \"http://www.swr3.de/-/id=211180/property=small/width=100/height=87/pubVersion=15/1mxtehu/index.jpg\",\n
|
44
|
-
\ \"width\": 100,\n \"height\": 87}\n \n
|
45
|
-
\ ,\"thumbnail\": { \"src\": \"http://www.swr3.de/-/id=211180/property=thumbnail/width=160/height=139/pubVersion=15/1p6camf/index.jpg\",\n
|
46
|
-
\ \"width\": 160,\n \"height\": 139}\n
|
47
|
-
\ \n ,\"zoom\": { \"src\": \"http://www.swr3.de/-/id=211180/property=zoom/width=500/height=435/pubVersion=15/n4isxq/index.jpg\",\n
|
48
|
-
\ \"width\": 500,\n \"height\": 435}\n
|
49
|
-
\ \n \n}\n , \"artist\" : { \"name\" : \"Billy Talent\"\n
|
50
|
-
\ , \"link\" : \"http://www.swr3.de/musik/poplexikon/Billy-Talent/-/id=927882/did=203054/14tqyuw/index.html\"\n
|
51
|
-
\ , \"externalId\" : \"williams_artist5897\" \n
|
52
|
-
\ },\n \"playDate\" : 1359832123000\n }\n ]}"
|
53
|
-
http_version:
|
54
|
-
recorded_at: Sat, 02 Feb 2013 19:16:10 GMT
|
55
|
-
- request:
|
56
|
-
method: get
|
57
|
-
uri: http://www.swr3.de/export/json/-/id=202234/gp1=1/wi3aps/index.json
|
58
|
-
body:
|
59
|
-
encoding: US-ASCII
|
60
|
-
string: ''
|
61
|
-
headers:
|
62
|
-
Accept-Encoding:
|
63
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
64
|
-
Accept:
|
65
|
-
- "*/*"
|
66
|
-
User-Agent:
|
67
|
-
- Ruby
|
68
|
-
response:
|
69
|
-
status:
|
70
|
-
code: 200
|
71
|
-
message: OK
|
72
|
-
headers:
|
73
|
-
Content-Type:
|
74
|
-
- application/json;charset=utf-8
|
75
|
-
Vary:
|
76
|
-
- Accept-Encoding
|
77
|
-
Expires:
|
78
|
-
- Fri, 30 Dec 2016 14:42:06 GMT
|
79
|
-
Cache-Control:
|
80
|
-
- max-age=0, no-cache, no-store
|
81
|
-
Pragma:
|
82
|
-
- no-cache
|
83
|
-
Date:
|
84
|
-
- Fri, 30 Dec 2016 14:42:06 GMT
|
85
|
-
Content-Length:
|
86
|
-
- '1519'
|
87
|
-
Connection:
|
88
|
-
- keep-alive
|
89
|
-
body:
|
90
|
-
encoding: UTF-8
|
91
|
-
string: "{ \"detail\": {\n \"@id\": \"202234\",\n \"leadText\": null,\n \"text\":
|
92
|
-
null,\n \"topline\": \"SWR3 Musikrecherche\",\n \"title\": \"Die letzten
|
93
|
-
13 Titel auf SWR3\",\n \"detailImages\": [\n ]}, \"frontmod\": [{ \"title\"
|
94
|
-
: \"My way\"\n , \"externalId\" : \"williams_title27120\"\n ,
|
95
|
-
\"cover\" : { \"@id\": \"4153020\",\n \"alt\": \"CD-Cover Harris, Calvin
|
96
|
-
- My way\",\n \"subline\": \"CD-Cover: Harris, Calvin - My way\",\n \"copyright\":
|
97
|
-
\"SWR3.de\"\n ,\"detail\": { \"src\": \"http://www.swr3.de/-/id=4153020/property=detail/width=200/height=200/794y3g/index.jpg\",\n
|
98
|
-
\ \"width\": 200,\n \"height\": 200}\n
|
99
|
-
\ \n ,\"small\": { \"src\": \"http://www.swr3.de/-/id=4153020/property=small/width=100/height=100/1iid4ll/index.jpg\",\n
|
100
|
-
\ \"width\": 100,\n \"height\": 100}\n
|
101
|
-
\ \n ,\"thumbnail\": { \"src\": \"http://www.swr3.de/-/id=4153020/property=thumbnail/width=160/height=160/953k3g/index.jpg\",\n
|
102
|
-
\ \"width\": 160,\n \"height\": 160}\n
|
103
|
-
\ \n ,\"zoom\": { \"src\": \"http://www.swr3.de/-/id=4153020/property=zoom/width=500/height=500/5y0d55/index.jpg\",\n
|
104
|
-
\ \"width\": 500,\n \"height\": 500}\n
|
105
|
-
\ \n \n}\n , \"artist\" : { \"name\" : \"Harris, Calvin\"\n
|
106
|
-
\ , \"link\" : \"http://www.swr3.de/musik/poplexikon/-/id=927882/did=342722/1ejk03z/index.html\"\n
|
107
|
-
\ , \"externalId\" : \"williams_artist6503\" \n
|
108
|
-
\ },\n \"playDate\" : 1483108845000\n }\n ]}"
|
109
|
-
http_version:
|
110
|
-
recorded_at: Fri, 30 Dec 2016 14:42:06 GMT
|
111
|
-
- request:
|
112
|
-
method: get
|
113
|
-
uri: http://www.swr3.de/export/json/-/id=202234/gp1=1/wi3aps/index.json
|
114
|
-
body:
|
115
|
-
encoding: US-ASCII
|
116
|
-
string: ''
|
117
|
-
headers:
|
118
|
-
Accept-Encoding:
|
119
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
120
|
-
Accept:
|
121
|
-
- "*/*"
|
122
|
-
User-Agent:
|
123
|
-
- Ruby
|
124
|
-
response:
|
125
|
-
status:
|
126
|
-
code: 200
|
127
|
-
message: OK
|
128
|
-
headers:
|
129
|
-
Content-Type:
|
130
|
-
- application/json;charset=utf-8
|
131
|
-
Vary:
|
132
|
-
- Accept-Encoding
|
133
|
-
Expires:
|
134
|
-
- Fri, 30 Dec 2016 14:42:08 GMT
|
135
|
-
Cache-Control:
|
136
|
-
- max-age=0, no-cache, no-store
|
137
|
-
Pragma:
|
138
|
-
- no-cache
|
139
|
-
Date:
|
140
|
-
- Fri, 30 Dec 2016 14:42:08 GMT
|
141
|
-
Content-Length:
|
142
|
-
- '1519'
|
143
|
-
Connection:
|
144
|
-
- keep-alive
|
145
|
-
body:
|
146
|
-
encoding: UTF-8
|
147
|
-
string: "{ \"detail\": {\n \"@id\": \"202234\",\n \"leadText\": null,\n \"text\":
|
148
|
-
null,\n \"topline\": \"SWR3 Musikrecherche\",\n \"title\": \"Die letzten
|
149
|
-
13 Titel auf SWR3\",\n \"detailImages\": [\n ]}, \"frontmod\": [{ \"title\"
|
150
|
-
: \"My way\"\n , \"externalId\" : \"williams_title27120\"\n ,
|
151
|
-
\"cover\" : { \"@id\": \"4153020\",\n \"alt\": \"CD-Cover Harris, Calvin
|
152
|
-
- My way\",\n \"subline\": \"CD-Cover: Harris, Calvin - My way\",\n \"copyright\":
|
153
|
-
\"SWR3.de\"\n ,\"detail\": { \"src\": \"http://www.swr3.de/-/id=4153020/property=detail/width=200/height=200/794y3g/index.jpg\",\n
|
154
|
-
\ \"width\": 200,\n \"height\": 200}\n
|
155
|
-
\ \n ,\"small\": { \"src\": \"http://www.swr3.de/-/id=4153020/property=small/width=100/height=100/1iid4ll/index.jpg\",\n
|
156
|
-
\ \"width\": 100,\n \"height\": 100}\n
|
157
|
-
\ \n ,\"thumbnail\": { \"src\": \"http://www.swr3.de/-/id=4153020/property=thumbnail/width=160/height=160/953k3g/index.jpg\",\n
|
158
|
-
\ \"width\": 160,\n \"height\": 160}\n
|
159
|
-
\ \n ,\"zoom\": { \"src\": \"http://www.swr3.de/-/id=4153020/property=zoom/width=500/height=500/5y0d55/index.jpg\",\n
|
160
|
-
\ \"width\": 500,\n \"height\": 500}\n
|
161
|
-
\ \n \n}\n , \"artist\" : { \"name\" : \"Harris, Calvin\"\n
|
162
|
-
\ , \"link\" : \"http://www.swr3.de/musik/poplexikon/-/id=927882/did=342722/1ejk03z/index.html\"\n
|
163
|
-
\ , \"externalId\" : \"williams_artist6503\" \n
|
164
|
-
\ },\n \"playDate\" : 1483108845000\n }\n ]}"
|
165
|
-
http_version:
|
166
|
-
recorded_at: Fri, 30 Dec 2016 14:42:08 GMT
|
167
|
-
- request:
|
168
|
-
method: get
|
169
|
-
uri: http://www.swr3.de/export/json/-/id=202234/gp1=1/wi3aps/index.json
|
5
|
+
uri: https://www.swr3.de/export/json/-/id=202234/gp1=1/wi3aps/index.json
|
170
6
|
body:
|
171
7
|
encoding: US-ASCII
|
172
8
|
string: ''
|
@@ -187,37 +23,50 @@ http_interactions:
|
|
187
23
|
Vary:
|
188
24
|
- Accept-Encoding
|
189
25
|
Expires:
|
190
|
-
-
|
26
|
+
- Thu, 13 Apr 2017 11:45:05 GMT
|
191
27
|
Cache-Control:
|
192
28
|
- max-age=0, no-cache, no-store
|
193
29
|
Pragma:
|
194
30
|
- no-cache
|
195
31
|
Date:
|
196
|
-
-
|
32
|
+
- Thu, 13 Apr 2017 11:45:05 GMT
|
197
33
|
Content-Length:
|
198
|
-
- '
|
34
|
+
- '1536'
|
199
35
|
Connection:
|
200
36
|
- keep-alive
|
37
|
+
Public-Key-Pins-Report-Only:
|
38
|
+
- pin-sha256="uZEfYpAZQZ0ZDHFSCdNkliD1JLHL+OQZudRMuHKKa3c="; pin-sha256="pvsOo/07kXBfe36yjJgm6H46EJRe7gurjSAeunJgFyg=";
|
39
|
+
pin-sha256="JbQbUG5JMJUoI6brnx0x3vZF6jilxsapbXGVfjhN8Fg="; includeSubdomains';
|
40
|
+
max-age=10; report-uri="https://swr3.report-uri.io/r/default/hpkp/reportOnly"
|
41
|
+
Content-Security-Policy-Report-Only:
|
42
|
+
- 'default-src ''self'' https:; script-src ''self'' ''unsafe-inline'' https:;
|
43
|
+
style-src ''self'' ''unsafe-inline'' https:; img-src ''self'' data: https:;
|
44
|
+
report-uri https://swr3.report-uri.io/r/default/csp/reportOnly;'
|
45
|
+
Content-Security-Policy:
|
46
|
+
- upgrade-insecure-requests
|
47
|
+
Strict-Transport-Security:
|
48
|
+
- max-age=31536000; preload
|
201
49
|
body:
|
202
50
|
encoding: UTF-8
|
203
51
|
string: "{ \"detail\": {\n \"@id\": \"202234\",\n \"leadText\": null,\n \"text\":
|
204
52
|
null,\n \"topline\": \"SWR3 Musikrecherche\",\n \"title\": \"Die letzten
|
205
53
|
13 Titel auf SWR3\",\n \"detailImages\": [\n ]}, \"frontmod\": [{ \"title\"
|
206
|
-
: \"
|
207
|
-
\"cover\" : { \"@id\": \"
|
208
|
-
-
|
209
|
-
\"SWR3.de\"\n ,\"detail\": { \"src\":
|
54
|
+
: \"We built this city\"\n , \"externalId\" : \"williams_title2760\"\n
|
55
|
+
\ , \"cover\" : { \"@id\": \"793426\",\n \"alt\": \"CD-Cover Starship
|
56
|
+
- We built this city\",\n \"subline\": \"CD-Cover: Starship - We built
|
57
|
+
this city\",\n \"copyright\": \"SWR3.de\"\n ,\"detail\": { \"src\":
|
58
|
+
\"https://www.swr3.de/-/id=793426/property=detail/width=200/height=200/17upc7z/index.jpg\",\n
|
210
59
|
\ \"width\": 200,\n \"height\": 200}\n
|
211
|
-
\ \n ,\"small\": { \"src\": \"
|
60
|
+
\ \n ,\"small\": { \"src\": \"https://www.swr3.de/-/id=793426/property=small/width=100/height=100/n07kii/index.jpg\",\n
|
212
61
|
\ \"width\": 100,\n \"height\": 100}\n
|
213
|
-
\ \n ,\"thumbnail\": { \"src\": \"
|
62
|
+
\ \n ,\"thumbnail\": { \"src\": \"https://www.swr3.de/-/id=793426/property=thumbnail/width=160/height=160/1ssz2oa/index.jpg\",\n
|
214
63
|
\ \"width\": 160,\n \"height\": 160}\n
|
215
|
-
\ \n ,\"zoom\": { \"src\": \"
|
64
|
+
\ \n ,\"zoom\": { \"src\": \"https://www.swr3.de/-/id=793426/property=zoom/width=500/height=500/10ii3sz/index.jpg\",\n
|
216
65
|
\ \"width\": 500,\n \"height\": 500}\n
|
217
|
-
\ \n \n}\n , \"artist\" : { \"name\" : \"
|
218
|
-
\
|
219
|
-
\ , \"externalId\" : \"
|
220
|
-
\ },\n \"playDate\" :
|
66
|
+
\ \n \n}\n , \"artist\" : { \"name\" : \"Starship\"\n ,
|
67
|
+
\"link\" : \"https://www.swr3.de/musik/poplexikon/-/id=927882/did=67074/varai6/index.html\"\n
|
68
|
+
\ , \"externalId\" : \"williams_artist1241\" \n
|
69
|
+
\ },\n \"playDate\" : 1492083718000\n }\n ]}"
|
221
70
|
http_version:
|
222
|
-
recorded_at:
|
71
|
+
recorded_at: Thu, 13 Apr 2017 11:45:05 GMT
|
223
72
|
recorded_with: VCR 3.0.3
|
@@ -23,16 +23,19 @@ class IntegrationTest < MiniTest::Test
|
|
23
23
|
@song = mocked('setup') do
|
24
24
|
SongMapper.map(Loader.load)
|
25
25
|
end
|
26
|
+
|
27
|
+
refute_nil(@song)
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_song
|
31
|
+
assert_equal('Starship: We built this city', @song.to_s)
|
26
32
|
end
|
27
33
|
|
28
34
|
def test_song_title
|
29
|
-
|
30
|
-
assert_equal('Red flag', @song.title)
|
31
|
-
assert_equal('Billy Talent: Red flag', @song.to_s)
|
35
|
+
assert_equal('We built this city', @song.title)
|
32
36
|
end
|
33
37
|
|
34
38
|
def test_artist
|
35
|
-
|
36
|
-
assert_equal('Billy Talent', @song.artist.name)
|
39
|
+
assert_equal('Starship', @song.artist.name)
|
37
40
|
end
|
38
41
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'helper'
|
4
|
+
|
5
|
+
require 'swr3_now_playing/mapper'
|
6
|
+
require 'swr3_now_playing/loader'
|
7
|
+
|
8
|
+
class SystemTest < MiniTest::Test
|
9
|
+
include SWR3::NowPlaying
|
10
|
+
|
11
|
+
def setup
|
12
|
+
@song = SongMapper.map(Loader.load)
|
13
|
+
refute_nil(@song)
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_song
|
17
|
+
refute_empty(@song.to_s)
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_song_title
|
21
|
+
refute_empty(@song.title)
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_artist
|
25
|
+
refute_nil(@song.artist)
|
26
|
+
refute_empty(@song.artist.name)
|
27
|
+
end
|
28
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swr3-nowplaying
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicholas E. Rabenau
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -266,6 +266,7 @@ files:
|
|
266
266
|
- test/fixtures/vcr/IntegrationTest_setup.yml
|
267
267
|
- test/helper.rb
|
268
268
|
- test/integration/test_all.rb
|
269
|
+
- test/system/test_all.rb
|
269
270
|
- test/unit/test_loader.rb
|
270
271
|
- test/unit/test_mapper.rb
|
271
272
|
- test/unit/test_song.rb
|
@@ -288,7 +289,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
288
289
|
version: '0'
|
289
290
|
requirements: []
|
290
291
|
rubyforge_project:
|
291
|
-
rubygems_version: 2.
|
292
|
+
rubygems_version: 2.6.11
|
292
293
|
signing_key:
|
293
294
|
specification_version: 4
|
294
295
|
summary: Provides the track that is currently playing in SWR3
|
@@ -299,6 +300,7 @@ test_files:
|
|
299
300
|
- test/fixtures/vcr/IntegrationTest_setup.yml
|
300
301
|
- test/helper.rb
|
301
302
|
- test/integration/test_all.rb
|
303
|
+
- test/system/test_all.rb
|
302
304
|
- test/unit/test_loader.rb
|
303
305
|
- test/unit/test_mapper.rb
|
304
306
|
- test/unit/test_song.rb
|