simple-websocket-vcr 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aa78b72b8e5e63014cea6cb0b968f16cf788309a
4
- data.tar.gz: ed9327485f96b7ef2833e992a6d535b944603d7d
3
+ metadata.gz: 07db3b356fae49d8678be826db4385fc6bf6880f
4
+ data.tar.gz: 5d854b9545dd30e617db2a79f2ecdb3ec87a4dca
5
5
  SHA512:
6
- metadata.gz: 216074d87f86830bc8f0838e7fa49c5dc53323a6bbc8ebc9c8d9fd40c600628e22696723f7cd38f40b6038a68fa3778e9643284933f2a8eac50541c4fa47acce
7
- data.tar.gz: 79922e89ebecf2b24ffef5433e66bd75f58969b815c2132ad88574d2ba19ffda089ee0c157ceb1f2b80e2467dd03e601c725d755989f08fede0756579fa024b2
6
+ metadata.gz: a41b9ad0e2d7411300cd34c4686e3fee453bf2d3c35e2817f12a0adc45b35d21d5a7267da88f743902fa218b1ed45801030c3f68711723ee759a0e055b2c45a0
7
+ data.tar.gz: 0571ed4745e4adef046058de4acd5ada65d9fea41965c7183085f5f33bcd72fa7b79cddceeb190fec0a79bdcbf5ea1b122e990b3b25c69b5c5d59feced7b293d
data/CHANGES.md CHANGED
@@ -3,7 +3,10 @@
3
3
  This document describes the relevant changes between releases of the
4
4
  _simple-websocket-vcr_ project.
5
5
 
6
- ### 0.0.7 (not released yet)
6
+ ### 0.0.8 (not released yet)
7
+
8
+ ### 0.0.7
9
+ * new option `record: all`
7
10
 
8
11
  ### 0.0.6
9
12
  * Reverse substitution for cassettes that have ERB. Basically, if we are recording and these options are passed: `erb: {some_key: some_value}, reverse_substitution: true`, then when the framework is about to store the `some_value` into cassette (JSON or YAML), the `<%= some_key =>` is stored instead of the value. So it allows to record the templates.
@@ -72,7 +72,7 @@ module WebSocketVCR
72
72
  # Use the specified cassette for either recording the real communication or replaying it during the tests.
73
73
  # @param name [String] the cassette
74
74
  # @param options [Hash] options for the cassette
75
- # @option options [Symbol] :record if set to :none there will be no recording
75
+ # @option options [Symbol] :record if set to :none there will be no recording; :all means record all the time
76
76
  # @option options [Symbol] :erb a sub-hash with variables used for ERB substitution in given cassette
77
77
  # @option options [Boolean] :reverse_substitution if true, the values of :erb hash will be replaced by their names in
78
78
  # the cassette. It's turned-off by default.
@@ -15,7 +15,7 @@ module WebSocketVCR
15
15
  @using_json = WebSocketVCR.configuration.json_cassettes
16
16
  @name += @using_json ? '.json' : '.yml'
17
17
 
18
- if File.exist?(filename)
18
+ if File.exist?(filename) && @options[:record] != :all
19
19
  @recording = false
20
20
  @sessions = initialize_sessions filename
21
21
  else
@@ -1,3 +1,3 @@
1
1
  module WebSocketVCR
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
@@ -0,0 +1 @@
1
+ some_explicitly_specified_cassette_that_should_be_re-recorded.*
@@ -153,6 +153,26 @@ describe 'VCR for WS' do
153
153
  expect(File.readlines(file_path).grep(/close/).size).to eq(1)
154
154
  end
155
155
 
156
+ it 'should re-record the tape if enforced' do
157
+ WebSocketVCR.configure do |c|
158
+ c.hook_uris = [HOST]
159
+ end
160
+ cassette_path = '/EXPLICIT/some_explicitly_specified_cassette_that_should_be_re-recorded'
161
+ WebSocketVCR.use_cassette(cassette_path) do
162
+ test_complex
163
+ end
164
+
165
+ file_path = "#{WebSocketVCR.configuration.cassette_library_dir}#{cassette_path}.yml"
166
+ original_last_modified = File.mtime(file_path)
167
+
168
+ # run the test again w/ record: :all option set
169
+ WebSocketVCR.use_cassette(cassette_path, record: :all) do
170
+ test_complex
171
+ end
172
+ new_last_modified = File.mtime(file_path)
173
+ expect(original_last_modified).to be < new_last_modified
174
+ end
175
+
156
176
  context 'automatically picked cassette name is ok, when using context foo' do
157
177
  it 'and example bar' do
158
178
  WebSocketVCR.record(example, self) do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-websocket-vcr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jirka Kremser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-06 00:00:00.000000000 Z
11
+ date: 2016-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: websocket-client-simple
@@ -147,6 +147,7 @@ files:
147
147
  - lib/simple_websocket_vcr/recordable_websocket_client.rb
148
148
  - lib/simple_websocket_vcr/version.rb
149
149
  - simple-websocket-vcr.gemspec
150
+ - spec/fixtures/vcr_cassettes/EXPLICIT/.gitignore
150
151
  - spec/fixtures/vcr_cassettes/EXPLICIT/some_explicitly_specified_json_cassette.json
151
152
  - spec/fixtures/vcr_cassettes/EXPLICIT/some_explicitly_specified_yaml_cassette.yml
152
153
  - spec/fixtures/vcr_cassettes/EXPLICIT/some_other_template.yml
@@ -188,6 +189,7 @@ signing_key:
188
189
  specification_version: 4
189
190
  summary: simple_websocket_vcr is VCR add-on for websockets.
190
191
  test_files:
192
+ - spec/fixtures/vcr_cassettes/EXPLICIT/.gitignore
191
193
  - spec/fixtures/vcr_cassettes/EXPLICIT/some_explicitly_specified_json_cassette.json
192
194
  - spec/fixtures/vcr_cassettes/EXPLICIT/some_explicitly_specified_yaml_cassette.yml
193
195
  - spec/fixtures/vcr_cassettes/EXPLICIT/some_other_template.yml