mr_video 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1 @@
1
+ "%������S��h�˯Wu;&�V�#�Y��
@@ -0,0 +1 @@
1
+ 34915
@@ -2,31 +2,24 @@ require 'rails_helper'
2
2
 
3
3
  describe MrVideo::Cassette do
4
4
  let(:model_class) { MrVideo::Cassette }
5
- let(:model) { model_class.find('bell_house') }
5
+ let(:name) { 'bell_house' }
6
+ let(:id) { MrVideo::IdService.encode(name) }
7
+ let(:model) { model_class.find(id) }
6
8
 
7
9
  subject { model }
8
10
 
9
11
  describe '#id' do
10
- let(:id) { model.id }
11
- subject { id }
12
- it { should == 'bell_house' }
12
+ subject { model.id }
13
+ it { should == id }
13
14
 
14
15
  context 'when cassette is in subdirectory' do
15
- let(:model) { model_class.find('test_subdirectory/dummy_cassette_2') }
16
- it { should == 'test_subdirectory/dummy_cassette_2' }
17
-
18
- context 'when rails version < 4.2.0' do
19
- before do
20
- Rails.stub(:version).and_return('4.1.9')
21
- end
22
- it { should == 'test_subdirectory%2Fdummy_cassette_2' }
23
- end
16
+ let(:name) { 'test_subdirectory/dummy_cassette_2' }
17
+ it { should == id }
24
18
  end
25
19
  end
26
20
 
27
21
  describe '#name' do
28
- let(:name) { model.name }
29
- subject { name }
22
+ subject { model.name }
30
23
  it { should == 'bell_house' }
31
24
  end
32
25
 
@@ -34,7 +27,7 @@ describe MrVideo::Cassette do
34
27
  let(:updated_at) { model.updated_at }
35
28
  subject { updated_at }
36
29
  it { should be_kind_of(DateTime) }
37
- end # #updated_at
30
+ end
38
31
 
39
32
  describe '#episodes' do
40
33
  let(:episodes) { model.episodes }
@@ -53,7 +46,7 @@ describe MrVideo::Cassette do
53
46
  it { should be }
54
47
  end
55
48
 
56
- end # #episodes
49
+ end
57
50
 
58
51
  describe '#destroy' do
59
52
  before do
@@ -64,13 +57,12 @@ describe MrVideo::Cassette do
64
57
  it 'should delete the file' do
65
58
  File.should have_received(:delete).with(model.send(:cassette_path))
66
59
  end
67
-
68
- end # #destroy
60
+ end
69
61
 
70
62
  describe '#to_param' do
71
63
  let(:to_param) { model.to_param }
72
64
  subject { to_param }
73
- it { should == 'bell_house' }
65
+ it { should == model.id }
74
66
  end
75
67
 
76
68
  describe '.all' do
@@ -81,9 +73,10 @@ describe MrVideo::Cassette do
81
73
 
82
74
  describe '.find' do
83
75
  context 'when name is from a subdirectory' do
84
- let(:model) { model_class.find('test_subdirectory%2Fdummy_cassette_2') }
76
+ let(:name) { 'test_subdirectory/dummy_cassette_2' }
77
+ let(:model) { model_class.find(id) }
85
78
  it { -> { model }.should_not raise_error }
86
79
  end
87
80
  end
88
81
 
89
- end # MrVideo::Cassette
82
+ end
@@ -2,7 +2,9 @@ require 'rails_helper'
2
2
 
3
3
  describe MrVideo::Episode do
4
4
  let(:episode_class) { MrVideo::Episode }
5
- let(:cassette) { MrVideo::Cassette.find('dummy_cassette') }
5
+ let(:name) { 'dummy_cassette' }
6
+ let(:id) { MrVideo::IdService.encode(name) }
7
+ let(:cassette) { MrVideo::Cassette.find(id) }
6
8
  let(:episode) { cassette.episodes[0] }
7
9
 
8
10
  subject { episode }
@@ -10,57 +12,51 @@ describe MrVideo::Episode do
10
12
  describe 'properties' do
11
13
 
12
14
  describe '#id' do
13
- let(:id) { episode.id }
14
- subject { id }
15
- it { should == episode.url.hash }
15
+ subject { episode.id }
16
+ it { should == MrVideo::IdService.encode(episode.url) }
16
17
  end
17
18
 
18
19
  describe '#url' do
19
- let(:url) { episode.url }
20
- subject { url }
20
+ subject { episode.url }
21
21
  it { should == 'http://www.thebellhouseny.com/calendar/' }
22
22
  end
23
23
 
24
24
  describe '#request_method' do
25
- let(:request_method) { episode.request_method }
26
- subject { request_method }
25
+ subject { episode.request_method }
27
26
  it { should == 'get' }
28
27
  end
29
28
 
30
29
  describe '#website_url' do
31
- let(:website_url) { episode.website_url }
32
- subject { website_url }
30
+ subject { episode.website_url }
33
31
  it { should == 'http://www.thebellhouseny.com' }
34
32
  end
35
33
 
36
34
  describe '#content' do
37
- let(:content) { episode.content }
38
- subject { content }
35
+ subject { episode.content }
39
36
  it { should match(/<html/) }
40
37
  end
41
38
 
42
39
  describe '#content_type' do
43
- let(:content_type) { episode.content_type }
44
- subject { content_type }
40
+ subject { episode.content_type }
45
41
  it { should == 'text/html; charset=UTF-8' }
46
42
  end
47
43
 
48
44
  describe '#recorded_at' do
49
- let(:recorded_at) { episode.recorded_at }
50
- subject { recorded_at }
45
+ subject { episode.recorded_at }
51
46
  it { should == Time.zone.parse('Wed, 04 Jun 2014 15:44:06').to_datetime }
52
47
  end
53
48
 
54
- end # properties
49
+ end
55
50
 
56
51
  describe '#to_param' do
57
- let(:to_param) { episode.to_param }
58
- subject { to_param }
52
+ subject { episode.to_param }
59
53
  it { should == episode.id.to_s }
60
54
  end
61
55
 
62
56
  describe '#destroy' do
63
- let(:original_cassette) { MrVideo::Cassette.find('dummy_cassette') }
57
+ let(:name) { 'dummy_cassette' }
58
+ let(:id) { MrVideo::IdService.encode(name) }
59
+ let(:original_cassette) { MrVideo::Cassette.find(id) }
64
60
 
65
61
  before do
66
62
  original_cassette.load
@@ -80,4 +76,4 @@ describe MrVideo::Episode do
80
76
 
81
77
  end
82
78
 
83
- end # MrVideo::Episode
79
+ end
@@ -0,0 +1,21 @@
1
+ require 'rails_helper'
2
+
3
+ describe MrVideo::IdService do
4
+ let(:service) { described_class }
5
+ subject { service }
6
+
7
+ describe '#encode' do
8
+ let(:value) { 'some/cassette/directory' }
9
+ let(:result) { service.encode(value) }
10
+ subject { result }
11
+
12
+ it 'should be encoded' do
13
+ expect(result).to eq('c29tZS9jYXNzZXR0ZS9kaXJlY3Rvcnk')
14
+ end
15
+
16
+ it 'should be decoded back to its original value' do
17
+ expect(service.decode(result)).to eq(value)
18
+ end
19
+ end
20
+
21
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mr_video
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Scharrenbroich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-05 00:00:00.000000000 Z
11
+ date: 2019-08-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Rails-based front-end for the popular VCR gem. It allows you to browse
14
14
  cassettes and episodes. HTTP body content from episodes can be viewed in the browser,
@@ -45,6 +45,7 @@ files:
45
45
  - app/models/mr_video/cassette.rb
46
46
  - app/models/mr_video/episode.rb
47
47
  - app/presenters/mr_video/episodes/show_presenter.rb
48
+ - app/services/mr_video/id_service.rb
48
49
  - app/views/layouts/mr_video.html.erb
49
50
  - app/views/mr_video/cassettes/destroy.js.erb
50
51
  - app/views/mr_video/cassettes/index.html.erb
@@ -173,6 +174,7 @@ files:
173
174
  - spec/dummy/tmp/cache/assets/sprockets/v3.0/lV/lVpszWpm79TavBbPgPpYqXjY5hGJtdp-G5wK7VjLFw0.cache
174
175
  - spec/dummy/tmp/cache/assets/sprockets/v3.0/nc/ncgp8oNk6rJaVlFQVqZzoBsGOpR6ikFU2kbyrZbV8LM.cache
175
176
  - spec/dummy/tmp/cache/assets/sprockets/v3.0/oF/oFbR54ASYRJ6ZKWqhBMiz6pihdcfsYaMsU_xzfaDcP4.cache
177
+ - spec/dummy/tmp/cache/assets/sprockets/v3.0/pJ/pJspW62xK1mllD_T4XVwqzip5rXbx2Nbvohap6qvfF0.cache
176
178
  - spec/dummy/tmp/cache/assets/sprockets/v3.0/pt/ptmaqoHmq7Lw6tbW0DJyumwwOWXs7SOBRRj0iVSZWVM.cache
177
179
  - spec/dummy/tmp/cache/assets/sprockets/v3.0/qA/qA2OY-dFWuqpBH3SGdUhSwl00GBjlqB4Hs4Uc3aIndI.cache
178
180
  - spec/dummy/tmp/cache/assets/sprockets/v3.0/t9/t9SERM8JMwvkx7lXy_myWkI0Eg_7Wk5IX_mtE1WLSM8.cache
@@ -189,6 +191,7 @@ files:
189
191
  - spec/dummy/tmp/cache/assets/sprockets/v3.0/y9/y9nrS9UIoTnJQRAPGNpOFhP-JBc7MKsb-Wqg5r4J6f0.cache
190
192
  - spec/dummy/tmp/cache/assets/sprockets/v3.0/yk/yk08lFXdjudSzT8bAqYb36Rqug_QAbnM5tJr1wJqWHI.cache
191
193
  - spec/dummy/tmp/cache/assets/sprockets/v3.0/z3/z3U5T0p6lWL8ZU2Vi_v6cqctuKkukNSQJPio49Dip0k.cache
194
+ - spec/dummy/tmp/pids/server.pid
192
195
  - spec/factories/factories.rb
193
196
  - spec/fixtures/vcr_cassettes/bell_house.yml
194
197
  - spec/fixtures/vcr_cassettes/brooklyn_bridge_park.yml
@@ -199,6 +202,7 @@ files:
199
202
  - spec/models/mr_video/cassette_spec.rb
200
203
  - spec/models/mr_video/episode_spec.rb
201
204
  - spec/rails_helper.rb
205
+ - spec/services/mr_video/id_service_spec.rb
202
206
  - spec/spec_helper.rb
203
207
  homepage: https://github.com/quidproquo/mr_video
204
208
  licenses: []
@@ -257,10 +261,12 @@ test_files:
257
261
  - spec/dummy/log/test.log
258
262
  - spec/dummy/log/production.log
259
263
  - spec/dummy/log/development.log
264
+ - spec/dummy/tmp/pids/server.pid
260
265
  - spec/dummy/tmp/cache/assets/sprockets/v3.0/6z/6zHn11r5YyUI4PysU-Ud8Ouq4k6hjlW4eJNl6X6i3NA.cache
261
266
  - spec/dummy/tmp/cache/assets/sprockets/v3.0/9W/9WnO_j4vYOC4e4QMoqlM9gQ1GfWx_NflZ-mXFbeZmsE.cache
262
267
  - spec/dummy/tmp/cache/assets/sprockets/v3.0/z3/z3U5T0p6lWL8ZU2Vi_v6cqctuKkukNSQJPio49Dip0k.cache
263
268
  - spec/dummy/tmp/cache/assets/sprockets/v3.0/YP/YPaFpZbv-qbEMTi08pGu3wzqBtIzjxki9VJG08xUGdM.cache
269
+ - spec/dummy/tmp/cache/assets/sprockets/v3.0/pJ/pJspW62xK1mllD_T4XVwqzip5rXbx2Nbvohap6qvfF0.cache
264
270
  - spec/dummy/tmp/cache/assets/sprockets/v3.0/9E/9EkegVGJgUHp1S32eAiLxHYgqUzVxughm1upsm1Veow.cache
265
271
  - spec/dummy/tmp/cache/assets/sprockets/v3.0/3w/3wWMPXtn7DcnxPGsoT-dTxPNRASrW9wO8htNwHZJ8-Y.cache
266
272
  - spec/dummy/tmp/cache/assets/sprockets/v3.0/yk/yk08lFXdjudSzT8bAqYb36Rqug_QAbnM5tJr1wJqWHI.cache
@@ -367,3 +373,4 @@ test_files:
367
373
  - spec/controllers/mr_video/cassettes_controller_spec.rb
368
374
  - spec/controllers/mr_video/episodes_controller_spec.rb
369
375
  - spec/rails_helper.rb
376
+ - spec/services/mr_video/id_service_spec.rb