mocha 2.8.0 → 2.8.1

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: f100e1c21f105d22752ae4ffc7740ba8fb351559679d3972ae5eea253725e082
4
- data.tar.gz: 31729a24bdde2da814bbf7d995fb77fc4c08dd7c98775bdb85d6d36fead87a35
3
+ metadata.gz: c403814a1f0f6fd604e2978ecbbd18341c543f9e894ce9da078e3ed277e5a92c
4
+ data.tar.gz: 55313439e576d54b112d313a8ce3e3ccca809e8716c0bccbeed1f6f87c33aadf
5
5
  SHA512:
6
- metadata.gz: 57b38d4f7b71f41156ea6dd278416864caed11866f1137a5605491000d3603b8793200d6275962b77ed71aaf09707333b88301451b809e9774e3180d594451cf
7
- data.tar.gz: 672e486d410a534ecf3eae8613294dfeb894c3fc8d324ae4414328e56ccd31ab9ebb46f13105b95cb3c1b0f35e5cd89eb6eeb5dee7493fbefe200dc03b251f0d
6
+ metadata.gz: 7383b0e2494d3cb257f21094204437fd86b2dfb55090642b036f0ed86facb0e8f6800933c8ebacc3b45145f4975d2aad0bfe84e772b683c33b5bb6fcfe0f9c03
7
+ data.tar.gz: 2963d0995efa21bff9ac7ee98e7b3ff321223a0a51d2dbc9d6011c490e00071b100e05e30026eebe5b43fae23c602f2da0398ff93b03b357ab349fd4eb7d108e
data/RELEASE.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Release Notes
2
2
 
3
+ ## 2.8.1
4
+
5
+ ### External changes
6
+
7
+ * Restore unqualified access to `ParameterMatchers` matcher classes, but deprecate such access (5231a4f7)
8
+ * Restore unqualified access to `ParameterMatchers::BaseMethods`, but deprecate such access (8a898567)
9
+
3
10
  ## 2.8.0
4
11
 
5
12
  Many thanks to @etiennebarrie for his help in testing v3.0.0 release candidates which led to many of these changes.
@@ -15,6 +22,10 @@ Many thanks to @etiennebarrie for his help in testing v3.0.0 release candidates
15
22
 
16
23
  * Move `ParameterMatchers#parse_option` -> `HasEntry.parse_option` (9e2a6f66)
17
24
 
25
+ **WARNING: This release accidentally removed access to ParameterMatchers classes**
26
+ * Fully-qualified access from within a test/spec class still works, e.g. `Mocha::ParameterMatchers::HasKey`, but unqualified access does not work, e.g. `HasKey`.
27
+ * The mistake has been fixed in v2.8.1 where unqualified access is restored but deprecated. Unqualified access will be removed in v3.
28
+
18
29
  ## 2.7.1
19
30
 
20
31
  ### External changes
@@ -1,6 +1,7 @@
1
1
  require 'mocha/api'
2
2
  require 'mocha/integration/assertion_counter'
3
3
  require 'mocha/expectation_error_factory'
4
+ require 'mocha/parameter_matchers/deprecations'
4
5
 
5
6
  module Mocha
6
7
  module Integration
@@ -22,7 +23,8 @@ module Mocha
22
23
  end
23
24
 
24
25
  # @private
25
- def self.included(_mod)
26
+ def self.included(mod)
27
+ mod.extend(Mocha::ParameterMatchers::Deprecations)
26
28
  Mocha::ExpectationErrorFactory.exception_class = ::Minitest::Assertion
27
29
  end
28
30
 
@@ -60,6 +60,8 @@ module Mocha
60
60
  end
61
61
  end
62
62
 
63
+ provide_deprecated_access_to(:BaseMethods)
64
+
63
65
  # @deprecated Include +BaseMethods+ module instead.
64
66
  class Base
65
67
  include BaseMethods
@@ -3,19 +3,17 @@ require 'set'
3
3
 
4
4
  module Mocha
5
5
  module ParameterMatchers
6
- module Methods
6
+ module Deprecations
7
7
  # @private
8
- def self.included(base)
9
- base.define_singleton_method(:const_missing) do |name|
10
- if ParameterMatchers.access_deprecated?(name)
11
- Mocha::ParameterMatchers.const_get(name).tap do |mod|
12
- Deprecation.warning(
13
- "Referencing #{name} outside its namespace is deprecated. Use fully-qualified #{mod} instead."
14
- )
15
- end
16
- else
17
- super(name)
8
+ def const_missing(name)
9
+ if ParameterMatchers.access_deprecated?(name)
10
+ ParameterMatchers.const_get(name).tap do |mod|
11
+ Deprecation.warning(
12
+ "Referencing #{name} outside its namespace is deprecated. Use fully-qualified #{mod} instead."
13
+ )
18
14
  end
15
+ else
16
+ super(name)
19
17
  end
20
18
  end
21
19
  end
data/lib/mocha/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mocha
2
- VERSION = '2.8.0'.freeze
2
+ VERSION = '2.8.1'.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.8.0
4
+ version: 2.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Mead
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-11-11 00:00:00.000000000 Z
11
+ date: 2025-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby2_keywords