mocha 2.3.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: d39bbef9363c1fb12001142111cd1e324a7c304100f456d0c723e9d839a15de4
4
- data.tar.gz: 9a91ce33d3fcacd82f4f4461da86042f66e9c0e0efdba61fbaf588aaddb0ce91
3
+ metadata.gz: bc6cb720040e8f8e9b422f5c96529de7d3d0a6d26d5b627cbce4edc070de0b84
4
+ data.tar.gz: 466f0bc9a7f8422150eaff6cfbff9bd6582c2ce71dbf72be894f6bcfc7c6fe33
5
5
  SHA512:
6
- metadata.gz: 0662556bb9f093c581bdea78f4484a0d8472dd63a7ee4589ebcdd4564628780e1cc68c32e9a4ae334d08ebe4bab75a9b9aeffe177a560e2e5424d9ff5349f4c7
7
- data.tar.gz: ecabbed8691ddaea029cb0272705c1701c5b2815bfca4236baa559ea6f53eef3e8f650be861b81a43b3e9dff59edcca8a195ccaea7e2ef31f0990e8873753ed4
6
+ metadata.gz: aacaeecf4b7e8eea1b2e4ae31bb19759a0c2045befc8cbe80ae9a9b32fb5af4dbaffc0bbefa228b33232b5cbd92c92c2e9aa61ca9660e0aa3f1500ac881606a1
7
+ data.tar.gz: 2c9b80dc28bd3a397e70fe93c4c383c4faac9429e028197396b0c192bda9445a14629e694f74b86d180bdbe54af6c80ad152491806f4226d237da137e7020722
data/RELEASE.md CHANGED
@@ -1,5 +1,15 @@
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
+
3
13
  ## 2.3.0
4
14
 
5
15
  ### 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
 
data/lib/mocha/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mocha
2
- VERSION = '2.3.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.3.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-05-17 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