mocha 2.2.0 → 2.4.0

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: a37edfad5feabba14a5fe1b5c1d9d7a7f367f412c73a464dc2d20404ad42fea0
4
- data.tar.gz: de9748735df4300f10a724b1eb6309f5262138ac3bc85bb0adbe6a9e64d09ec5
3
+ metadata.gz: bc6cb720040e8f8e9b422f5c96529de7d3d0a6d26d5b627cbce4edc070de0b84
4
+ data.tar.gz: 466f0bc9a7f8422150eaff6cfbff9bd6582c2ce71dbf72be894f6bcfc7c6fe33
5
5
  SHA512:
6
- metadata.gz: b2b4635c867e2670144fe93b7b9f2822429fb3f9df7ad7242fb5242832cd775c392eb624dc45706fd5c4d55802a921381ce801bf1ccc3050c9ef912eb9641d07
7
- data.tar.gz: 56a349f9e87ab72e3e1a34d006c02bfef4afdffdc22991c9b1cd450f65d644203fdbc73a7559990eca6dea7a25dbc3765364c02ad86560b5968f7cb75a72e3ec
6
+ metadata.gz: aacaeecf4b7e8eea1b2e4ae31bb19759a0c2045befc8cbe80ae9a9b32fb5af4dbaffc0bbefa228b33232b5cbd92c92c2e9aa61ca9660e0aa3f1500ac881606a1
7
+ data.tar.gz: 2c9b80dc28bd3a397e70fe93c4c383c4faac9429e028197396b0c192bda9445a14629e694f74b86d180bdbe54af6c80ad152491806f4226d237da137e7020722
data/RELEASE.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Release Notes
2
2
 
3
+ ## 2.4.0
4
+
5
+ ### External changes
6
+
7
+ * Improve rendering of keyword arguments (#652) - thanks to @casperisfine
8
+
9
+ ### Internal changes
10
+
11
+ * Improvements to `#mocha_inspect` unit tests (#650)
12
+
13
+ ## 2.3.0
14
+
15
+ ### External changes
16
+
17
+ * Fix nested parameter matching for keyword arguments (f94e2504, #648) - thanks to @CodingAnarchy for reporting
18
+
3
19
  ## 2.2.0
4
20
 
5
21
  ### External changes
data/lib/mocha/inspect.rb CHANGED
@@ -19,8 +19,19 @@ module Mocha
19
19
 
20
20
  module HashMethods
21
21
  def mocha_inspect
22
- unwrapped = collect { |key, value| "#{key.mocha_inspect} => #{value.mocha_inspect}" }.join(', ')
23
- Hash.ruby2_keywords_hash?(self) ? unwrapped : "{#{unwrapped}}"
22
+ if Hash.ruby2_keywords_hash?(self)
23
+ collect do |key, value|
24
+ case key
25
+ when Symbol
26
+ "#{key}: #{value.mocha_inspect}"
27
+ else
28
+ "#{key.mocha_inspect} => #{value.mocha_inspect}"
29
+ end
30
+ end.join(', ')
31
+ else
32
+ unwrapped = collect { |key, value| "#{key.mocha_inspect} => #{value.mocha_inspect}" }.join(', ')
33
+ "{#{unwrapped}}"
34
+ end
24
35
  end
25
36
  end
26
37
 
@@ -13,7 +13,8 @@ module Mocha
13
13
 
14
14
  def matches?(available_parameters)
15
15
  parameter, is_last_parameter = extract_parameter(available_parameters)
16
- return false unless parameter == @value
16
+
17
+ return false unless HasEntries.new(@value).matches?([parameter])
17
18
 
18
19
  if is_last_parameter && !same_type_of_hash?(parameter, @value)
19
20
  return false if Mocha.configuration.strict_keyword_argument_matching?
data/lib/mocha/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mocha
2
- VERSION = '2.2.0'.freeze
2
+ VERSION = '2.4.0'.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.2.0
4
+ version: 2.4.0
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-04-10 00:00:00.000000000 Z
11
+ date: 2024-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby2_keywords