rspec-mocks 3.6.0.beta1 → 3.6.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8dc8b700a6acee68e71a9a6d76459b12a975c818
4
- data.tar.gz: b6a18ff9aed7115428b4011af1a7d060a856fef9
3
+ metadata.gz: a6c37eb5169117ac444e7a9d41ab4f5b15dad89b
4
+ data.tar.gz: 497665104d3a18cc63b7885ff5245aef032adcdb
5
5
  SHA512:
6
- metadata.gz: c78d4ae88eb1df7fc1b6d5f91da6f14723a9033cbefe482673bed82a4dd9f74042ced61b9c06301f8d159b42401adaaf85a071884f56661b7a35c2f8308976b5
7
- data.tar.gz: 49a87bccd1d7d8bbe7b60225dd353bee56d41d2603e1060f887d9f70379fe15056ea8f7f417593a88a62dfe210b954d057d4b255bbf7600bda1894e8472551f2
6
+ metadata.gz: 305e32ea97e0a65321396c04656441e7691b426e0189897ac4f93e21f85f5e39b670b3d7bc056d7a23e19c12f0cac5d6a9f0e0dfaca163ce8e769e57b1ca2255
7
+ data.tar.gz: ae7fd2b5cf7cade09e6b1228af2da53a9249d060acd8e3160eb1b448d8516bb3cb84250e5a216cbce1f4d207dbc02561cef09f6188a4f6d9d37c281e38e82b61
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,12 @@
1
+ ### 3.6.0.beta2 / 2016-12-12
2
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.6.0.beta1...v3.6.0.beta2)
3
+
4
+ Enhancements:
5
+
6
+ * Add new `without_partial_double_verification { }` API that lets you
7
+ temporarily turn off partial double verification for an example.
8
+ (Jon Rowe, #1104)
9
+
1
10
  ### 3.6.0.beta1 / 2016-10-09
2
11
  [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.5.0...v3.6.0.beta1)
3
12
 
@@ -8,6 +8,7 @@ module RSpec
8
8
  @verify_doubled_constant_names = false
9
9
  @transfer_nested_constants = false
10
10
  @verify_partial_doubles = false
11
+ @temporarily_suppress_partial_double_verification = false
11
12
  end
12
13
 
13
14
  # Sets whether RSpec will warn, ignore, or fail a test when
@@ -153,6 +154,11 @@ module RSpec
153
154
  @verify_partial_doubles
154
155
  end
155
156
 
157
+ # @private
158
+ # Used to track wether we are temporarily suppressing verifying partial
159
+ # doubles with `without_partial_double_verification { ... }`
160
+ attr_accessor :temporarily_suppress_partial_double_verification
161
+
156
162
  if ::RSpec.respond_to?(:configuration)
157
163
  def color?
158
164
  ::RSpec.configuration.color_enabled?
@@ -282,6 +282,18 @@ module RSpec
282
282
  Matchers::HaveReceived.new(method_name, &block)
283
283
  end
284
284
 
285
+ # Turns off the verifying of partial doubles for the duration of the
286
+ # block, this is useful in situations where methods are defined at run
287
+ # time and you wish to define stubs for them but not turn off partial
288
+ # doubles for the entire run suite. (e.g. view specs in rspec-rails).
289
+ def without_partial_double_verification
290
+ original_state = Mocks.configuration.temporarily_suppress_partial_double_verification
291
+ Mocks.configuration.temporarily_suppress_partial_double_verification = true
292
+ yield
293
+ ensure
294
+ Mocks.configuration.temporarily_suppress_partial_double_verification = original_state
295
+ end
296
+
285
297
  # @method expect
286
298
  # Used to wrap an object in preparation for setting a mock expectation
287
299
  # on it.
@@ -330,7 +330,7 @@ module RSpec
330
330
  def ordered(&block)
331
331
  if type == :stub
332
332
  RSpec.warning(
333
- "`allow(...).to receive(..).ordered` is not supported and will" \
333
+ "`allow(...).to receive(..).ordered` is not supported and will " \
334
334
  "have no effect, use `and_return(*ordered_values)` instead."
335
335
  )
336
336
  end
@@ -120,6 +120,11 @@ module RSpec
120
120
  optional_callback_invocation_strategy.call(@doubled_module)
121
121
  end
122
122
 
123
+ def ensure_implemented(_method_name)
124
+ return if Mocks.configuration.temporarily_suppress_partial_double_verification
125
+ super
126
+ end
127
+
123
128
  def method_reference
124
129
  @method_doubles
125
130
  end
@@ -193,6 +198,8 @@ module RSpec
193
198
  def self.for(object, method_name, proxy)
194
199
  if ClassNewMethodReference.applies_to?(method_name) { object }
195
200
  VerifyingExistingClassNewMethodDouble
201
+ elsif Mocks.configuration.temporarily_suppress_partial_double_verification
202
+ MethodDouble
196
203
  else
197
204
  self
198
205
  end.new(object, method_name, proxy)
@@ -3,7 +3,7 @@ module RSpec
3
3
  # Version information for RSpec mocks.
4
4
  module Version
5
5
  # Version of RSpec mocks currently in use in SemVer format.
6
- STRING = '3.6.0.beta1'
6
+ STRING = '3.6.0.beta2'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-mocks
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.0.beta1
4
+ version: 3.6.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Baker
@@ -45,7 +45,7 @@ cert_chain:
45
45
  ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
46
46
  F3MdtaDehhjC
47
47
  -----END CERTIFICATE-----
48
- date: 2016-10-10 00:00:00.000000000 Z
48
+ date: 2016-12-12 00:00:00.000000000 Z
49
49
  dependencies:
50
50
  - !ruby/object:Gem::Dependency
51
51
  name: rspec-support
@@ -53,14 +53,14 @@ dependencies:
53
53
  requirements:
54
54
  - - '='
55
55
  - !ruby/object:Gem::Version
56
- version: 3.6.0.beta1
56
+ version: 3.6.0.beta2
57
57
  type: :runtime
58
58
  prerelease: false
59
59
  version_requirements: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - '='
62
62
  - !ruby/object:Gem::Version
63
- version: 3.6.0.beta1
63
+ version: 3.6.0.beta2
64
64
  - !ruby/object:Gem::Dependency
65
65
  name: diff-lcs
66
66
  requirement: !ruby/object:Gem::Requirement
@@ -210,9 +210,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
210
210
  version: 1.3.1
211
211
  requirements: []
212
212
  rubyforge_project:
213
- rubygems_version: 2.2.2
213
+ rubygems_version: 2.5.1
214
214
  signing_key:
215
215
  specification_version: 4
216
- summary: rspec-mocks-3.6.0.beta1
216
+ summary: rspec-mocks-3.6.0.beta2
217
217
  test_files: []
218
218
  has_rdoc:
metadata.gz.sig CHANGED
Binary file