mocha 2.4.1 → 2.4.2

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
  SHA256:
3
- metadata.gz: 365de18bfd8d5aa67a5baf350c2a89082f702aef92ca581a78bd427529654f36
4
- data.tar.gz: 8b989ea9c7fea12a78a82ab2db2cd2600793b32e513348e9eb7ea7d4d41094fc
3
+ metadata.gz: 1ea825862f801a2e95a196ca677bb98aa6d7b9c51a8eb5a3cfcb9e8dea8baabb
4
+ data.tar.gz: b6f0b63c97d5ec4df6aabc7e8675f7d1b2ba8a99833f724fa9e2087aaa40bdeb
5
5
  SHA512:
6
- metadata.gz: 131e1759a21fd24f1ec7ed7a222626b6fd326a72a4bd38b720c45bac3e800e4b563c28827caf539a397bc9734ab42d1bec03ae8f4c112edeccb61a995d7d3cfb
7
- data.tar.gz: cf625e741f8324539cd315a7c716cbac1311d0d42db68b4bcf72fe663676a55753b5fa6073bb05c58e169e419fc810822d36bf06db174c49bd24ca7f7391b195
6
+ metadata.gz: 4b9b72dfc0e523bf8b7c50211e13ee63379fefa565474c755475032bf5dfb6f3d736fcbbf32884a2b9e153a2141b4fc3a291fbf7a2997e9810cb71e0817f3234
7
+ data.tar.gz: 61f87b76172af493bf4f2354f2638a939d122388490d56179e8bc1c719b95af97815fa860c2936cfc88980bd7bb547689c5ad53941c731acd42a1c10de3d855b
data/.rubocop.yml CHANGED
@@ -36,6 +36,11 @@ Style/WhileUntilModifier:
36
36
  Style/AccessModifierDeclarations:
37
37
  Enabled: false
38
38
 
39
+ # `Module#===` is useful in presence of objects such as mocks
40
+ # that may have a `is_a?` implementation that lies.
41
+ Style/CaseEquality:
42
+ Enabled: false
43
+
39
44
  # This is useful when using `ExecutionPoint.current` to make tests more robust
40
45
  Style/Semicolon:
41
46
  Enabled: false
data/RELEASE.md CHANGED
@@ -1,10 +1,16 @@
1
1
  # Release Notes
2
2
 
3
+ ## 2.4.2
4
+
5
+ ### External changes
6
+
7
+ * Don't trust `Object#is_a?` in presence of mock objects (#656) - thanks to @casperisfine
8
+
3
9
  ## 2.4.1
4
10
 
5
11
  ### External changes
6
12
 
7
- * Fix regression in matchers when used with keyword arguments (#648, #655) - thanks to @ElvinEfendi for reporting
13
+ * Fix regression in matchers when used with keyword arguments (#654 & #655) - thanks to @ElvinEfendi for reporting
8
14
 
9
15
  ### Internal changes
10
16
 
@@ -8,9 +8,9 @@ module Mocha
8
8
  module InstanceMethods
9
9
  # @private
10
10
  def to_matcher(expectation: nil, top_level: false)
11
- if is_a?(Base)
11
+ if Base === self
12
12
  self
13
- elsif is_a?(Hash) && top_level
13
+ elsif Hash === self && top_level
14
14
  Mocha::ParameterMatchers::PositionalOrKeywordHash.new(self, expectation)
15
15
  else
16
16
  Mocha::ParameterMatchers::Equals.new(self)
data/lib/mocha/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mocha
2
- VERSION = '2.4.1'.freeze
2
+ VERSION = '2.4.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mocha
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.1
4
+ version: 2.4.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: 2024-07-16 00:00:00.000000000 Z
11
+ date: 2024-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby2_keywords