camcorder 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/camcorder/recorder.rb +2 -2
- data/lib/camcorder/version.rb +1 -1
- data/spec/camcorder/recorder_spec.rb +23 -23
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89096f4a1f052334ca47a32755400159a4e17db0
|
4
|
+
data.tar.gz: bd317603915f7fa901529dd48ef09a1361d81370
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9836f7c0991832dd8612b42a45cace1ff75989bb9c888450d7ffc4ce64cdbed130b4f0b134d61056cd03b6203dbde638d02fed4c87c8966ced3bb1d5ea64d24
|
7
|
+
data.tar.gz: afefa67a4185e008672c521d3fa2ee8a4740e34c5af9a44d4c2b7eb26a883feadd9aeeb2866319dc8f41bc7c979a6ac377767f12f19724205f5f09d128e8895f
|
data/README.md
CHANGED
data/lib/camcorder/recorder.rb
CHANGED
@@ -2,7 +2,7 @@ require 'yaml'
|
|
2
2
|
require 'camcorder/recording'
|
3
3
|
|
4
4
|
module Camcorder
|
5
|
-
|
5
|
+
|
6
6
|
class Recorder
|
7
7
|
|
8
8
|
attr_reader :recordings
|
@@ -52,7 +52,7 @@ module Camcorder
|
|
52
52
|
@changed = true
|
53
53
|
if recordings.has_key?(key)
|
54
54
|
if recordings[key] != recording
|
55
|
-
raise RecordingError(key)
|
55
|
+
raise RecordingError.new(key)
|
56
56
|
end
|
57
57
|
else
|
58
58
|
recordings[key] = recording
|
data/lib/camcorder/version.rb
CHANGED
@@ -2,17 +2,17 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
|
4
4
|
describe Camcorder::Recorder do
|
5
|
-
|
5
|
+
|
6
6
|
subject{ Camcorder::Recorder.new(filename) }
|
7
|
-
|
7
|
+
|
8
8
|
describe '.transaction' do
|
9
|
-
|
9
|
+
|
10
10
|
let(:key) { 'key' }
|
11
|
-
|
11
|
+
|
12
12
|
context 'when recording exists' do
|
13
|
-
|
13
|
+
|
14
14
|
let(:filename) { 'spec/fixtures/should_exist.yml'}
|
15
|
-
|
15
|
+
|
16
16
|
it 'should return recorded value' do
|
17
17
|
subject.transaction do
|
18
18
|
result = subject.record 'key' do
|
@@ -23,7 +23,7 @@ describe Camcorder::Recorder do
|
|
23
23
|
expect(result).to eq('dis be da result')
|
24
24
|
end
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
27
|
it 'should error on unknown key' do
|
28
28
|
expect {
|
29
29
|
subject.transaction do
|
@@ -33,13 +33,13 @@ describe Camcorder::Recorder do
|
|
33
33
|
end
|
34
34
|
}.to raise_error(Camcorder::PlaybackError)
|
35
35
|
end
|
36
|
-
|
36
|
+
|
37
37
|
end
|
38
|
-
|
38
|
+
|
39
39
|
context 'when block raises' do
|
40
|
-
|
40
|
+
|
41
41
|
let(:filename) { 'spec/fixtures/haz_errorz.yml'}
|
42
|
-
|
42
|
+
|
43
43
|
it 'should reraise from recording' do
|
44
44
|
expect {
|
45
45
|
subject.transaction do
|
@@ -50,31 +50,31 @@ describe Camcorder::Recorder do
|
|
50
50
|
end
|
51
51
|
}.to raise_error(StandardError)
|
52
52
|
end
|
53
|
-
|
53
|
+
|
54
54
|
end
|
55
|
-
|
55
|
+
|
56
56
|
context 'when no recording exists' do
|
57
|
-
|
57
|
+
|
58
58
|
let(:filename) { 'spec/fixtures/should_not_exist.yml'}
|
59
|
-
|
59
|
+
|
60
60
|
after do
|
61
61
|
File.delete(filename)
|
62
62
|
end
|
63
|
-
|
63
|
+
|
64
64
|
it 'should create recording' do
|
65
|
-
|
66
|
-
expect(File.exists?(filename)).to
|
65
|
+
|
66
|
+
expect(File.exists?(filename)).to be_falsey
|
67
67
|
subject.transaction do
|
68
68
|
subject.record 'key' do
|
69
69
|
'dis be da result'
|
70
70
|
end
|
71
71
|
end
|
72
|
-
expect(File.exists?(filename)).to
|
73
|
-
|
72
|
+
expect(File.exists?(filename)).to be_truthy
|
73
|
+
|
74
74
|
end
|
75
|
-
|
75
|
+
|
76
76
|
end
|
77
|
-
|
77
|
+
|
78
78
|
end
|
79
|
-
|
79
|
+
|
80
80
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: camcorder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gordon L. Hempton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|
94
94
|
rubyforge_project:
|
95
|
-
rubygems_version: 2.2.
|
95
|
+
rubygems_version: 2.2.2
|
96
96
|
signing_key:
|
97
97
|
specification_version: 4
|
98
98
|
summary: VCR-like recording for arbitrary method invocations.
|