mocha 2.0.0 → 2.0.2

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
  SHA256:
3
- metadata.gz: 4f52376e6c8b1042085cca75e7d22e0241452dca80e73de22510f39a83041030
4
- data.tar.gz: aa4584255d27f58ee1e9c18935921e352044ac8c2cc91d97221d280e21c54b29
3
+ metadata.gz: 4f349dc7259b6d387aaf194adc6c6f93fe39b9b785ce42489e2abf168c58dc84
4
+ data.tar.gz: '08a9210b39673183198a69a82d368b14af06722cc136a72635638b69a7a9e1b1'
5
5
  SHA512:
6
- metadata.gz: d23cc4f2cb0ffcf1464103c1bca607d8a2fac7fef3592dc4637d25ed72dbfd91f5d7234c9f4df23f1c27248829b6638013396e780212f41d9a44236b7a95bd16
7
- data.tar.gz: efbcf261aab3292625c56f9f8cab796a19b4dc1ac474a64041ee1a6a92e72c4941b1ce0a0299322e682607d8e8c92598da7ffe853de1257cd92f49027b0891d4
6
+ metadata.gz: 1d77dedb5f4016ab1f2932a18b9d574a0e1de87ab0bc77cf5757920c8ca231a2c5872688a5c1dc8dbd530e81d9e8f1c6feb218c469126685ca822e953c568263
7
+ data.tar.gz: 6545a73cfed1eb00f94ca06f1cd12606db4377c6e8a5f228a512464e106e129a584d6cedf195602dad45398a2e8346e2abd98c353209e41a4b13da64a9fbc635
data/Gemfile CHANGED
@@ -28,5 +28,3 @@ if ENV['MOCHA_GENERATE_DOCS']
28
28
  gem 'redcarpet'
29
29
  gem 'yard'
30
30
  end
31
-
32
- gem 'ruby2_keywords', '~> 0.0.5'
data/RELEASE.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Release Notes
2
2
 
3
+ ## 2.0.2
4
+
5
+ ### External changes
6
+
7
+ * Fix regression in `Mock#responds_like` behaviour - thanks to @adrianna-chang-shopify for reporting (#580,#583,ba4d619e)
8
+
9
+ ## 2.0.1
10
+
11
+ ### External changes
12
+
13
+ * Fix `LoadError` when using v2.0.0 with Ruby < v2.7 by moving declaration of runtime dependency on `ruby2_keywords` gem from `Gemfile` to `mocha.gemspec` - thanks to @mishina2228 for reporting (#581, #582, cdeb0356)
14
+
3
15
  ## 2.0.0
4
16
 
5
17
  ### External changes
@@ -35,6 +47,12 @@ from the Ruby v1.8 standard library are no longer supported (#540,969f4845)
35
47
  * Add missing `require` statement (73493761)
36
48
  * Disable Style/Semicolon cop globally (8cd0b705)
37
49
 
50
+ ## 1.16.1
51
+
52
+ ### External changes
53
+
54
+ * Fix regression in `Mock#responds_like` behaviour - thanks to @adrianna-chang-shopify for reporting (#580,#583,77af2af1)
55
+
38
56
  ## 1.16.0
39
57
 
40
58
  ### External changes
@@ -46,6 +64,12 @@ from the Ruby v1.8 standard library are no longer supported (#540,969f4845)
46
64
 
47
65
  * Remove redundant deprecation disabling in MockTest (dc8ca969)
48
66
 
67
+ ## 1.15.1
68
+
69
+ ### External changes
70
+
71
+ * Fix regression in `Mock#responds_like` behaviour - thanks to @adrianna-chang-shopify for reporting (#580,#583,c586a08c)
72
+
49
73
  ## 1.15.0
50
74
 
51
75
  ### External changes
data/lib/mocha/mock.rb CHANGED
@@ -183,11 +183,11 @@ module Mocha
183
183
  end
184
184
  end
185
185
 
186
- # Constrains the {Mock} instance so that it can only expect or stub methods to which +responder+ responds. The constraint is only applied at method invocation time.
186
+ # Constrains the {Mock} instance so that it can only expect or stub methods to which +responder+ responds publicly. The constraint is only applied at method invocation time.
187
187
  #
188
- # A +NoMethodError+ will be raised if the +responder+ does not +#respond_to?+ a method invocation (even if the method has been expected or stubbed).
188
+ # A +NoMethodError+ will be raised if the +responder+ does not publicly +#respond_to?+ the invoked method (even if the method has been expected or stubbed).
189
189
  #
190
- # The {Mock} instance will delegate its +#respond_to?+ method to the +responder+.
190
+ # The {Mock} instance will delegate its +#respond_to?+ method to the +responder+. However, the +include_all+ parameter is not passed through, so only public methods on the +responder+ will be considered.
191
191
  #
192
192
  # Note that the methods on +responder+ are never actually invoked.
193
193
  #
@@ -237,11 +237,11 @@ module Mocha
237
237
  self
238
238
  end
239
239
 
240
- # Constrains the {Mock} instance so that it can only expect or stub methods to which an instance of the +responder_class+ responds. The constraint is only applied at method invocation time. Note that the responder instance is instantiated using +Class#allocate+.
240
+ # Constrains the {Mock} instance so that it can only expect or stub methods to which an instance of the +responder_class+ responds publicly. The constraint is only applied at method invocation time. Note that the responder instance is instantiated using +Class#allocate+.
241
241
  #
242
- # A +NoMethodError+ will be raised if the responder instance does not +#respond_to?+ a method invocation (even if the method has been expected or stubbed).
242
+ # A +NoMethodError+ will be raised if the responder instance does not publicly +#respond_to?+ the invoked method (even if the method has been expected or stubbed).
243
243
  #
244
- # The {Mock} instance will delegate its +#respond_to?+ method to the responder instance.
244
+ # The {Mock} instance will delegate its +#respond_to?+ method to the responder instance. However, the +include_all+ parameter is not passed through, so only public methods on the +responder+ will be considered.
245
245
  #
246
246
  # Note that the methods on the responder instance are never actually invoked.
247
247
  #
@@ -329,9 +329,9 @@ module Mocha
329
329
  end
330
330
 
331
331
  # @private
332
- def respond_to_missing?(symbol, include_all)
332
+ def respond_to_missing?(symbol, _include_all)
333
333
  if @responder
334
- @responder.respond_to?(symbol, include_all)
334
+ @responder.respond_to?(symbol)
335
335
  else
336
336
  @everything_stubbed || all_expectations.matches_method?(symbol)
337
337
  end
data/lib/mocha/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mocha
2
- VERSION = '2.0.0'.freeze
2
+ VERSION = '2.0.2'.freeze
3
3
  end
data/mocha.gemspec CHANGED
@@ -21,4 +21,6 @@ Gem::Specification.new do |s|
21
21
  s.homepage = 'https://mocha.jamesmead.org'
22
22
  s.require_paths = ['lib']
23
23
  s.summary = 'Mocking and stubbing library'
24
+
25
+ s.add_runtime_dependency 'ruby2_keywords', '>= 0.0.5'
24
26
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mocha
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Mead
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-01 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2022-11-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: ruby2_keywords
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.0.5
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 0.0.5
13
27
  description: Mocking and stubbing library with JMock/SchMock syntax, which allows
14
28
  mocking and stubbing of methods on real (non-mock) classes.
15
29
  email: mocha-developer@googlegroups.com