rspec-support 3.8.0 → 3.9.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
- SHA1:
3
- metadata.gz: 631283161faf72604c2081235f9acbbda6ea980f
4
- data.tar.gz: 99170c1beccff1f998787873e0bd156af46ca9ef
2
+ SHA256:
3
+ metadata.gz: '0608e9d9e32db7972f9ed9edf1acc660be6e859589a5bb40118979f32e3e3093'
4
+ data.tar.gz: df94499781e6a3f6460990392a90bcea42c4c1aaa028357139787ab1b92716df
5
5
  SHA512:
6
- metadata.gz: 23464780384e45e24c4a8a8255dce0f78d0afd406723d817d68ef66d20a8c0d973d40bdc6bee54188e9714c6ffb20b116045a08bb9c90aa11cb2ec2bdea453a6
7
- data.tar.gz: 4b08b17ebd14c92b615d9d6838d1be78c32b9e695933c895bb99710693bec391736ce26864f139c0e22f794e085367aa5cf0081b659068994cffddbfea23f0bc
6
+ metadata.gz: 7598c046151adc5322cddd117f5809c3b3f9b1271c5db74496d6961e0799c1fbf3a47d2b48f1195be96b3c2ce0baab7c11d2f19709d478fc44848523034b9514
7
+ data.tar.gz: f548fa1b506985c64d9d612463cb4ffb8b41233a86af16ee26449e936570dbe0d4c2f2d9ad5c7fe3cd1a1b57d3156fba368b2f44627634053c2f1db51f64fc6d
@@ -1,2 +1,3 @@
1
- 7��,�HXj'�:������V����Mu��<�[%�8��b8���)žN�$�tA�N�`ʘ>zQ(���8��������,���BM��g辋g�}Ԅ�&�_
2
- q��ѡ�>e-���}8Yn+߀��>���?r����O9��;l�����Sw� �?�AZ�H���B���o�Ę!�Z�p��b�/sQH��B]K����� ���.`�ƿ��ĹO�R���P��Z6Ȯ���
1
+ i|?��R�.�����m!�~��L29�[�&� x=
2
+ ��f��l��䦆��; ��O�� t[j���wr�bE�&W[p
3
+ ^S�:�$zXPL�o��
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,53 @@
1
+ ### 3.9.2 / 2019-12-30
2
+ [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.9.1...v3.9.2)
3
+
4
+ Bug Fixes:
5
+
6
+ * Remove unneeded eval. (Matijs van Zuijlen, #394)
7
+
8
+ ### 3.9.1 / 2019-12-28
9
+ [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.9.0...v3.9.1)
10
+
11
+ Bug Fixes:
12
+
13
+ * Remove warning caused by keyword arguments on Ruby 2.7.0.
14
+ (Jon Rowe, #392)
15
+
16
+ ### 3.9.0 / 2019-10-07
17
+ [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.8.3...v3.9.0)
18
+
19
+ *NO CHANGES*
20
+
21
+ Version 3.9.0 was released to allow other RSpec gems to release 3.9.0.
22
+
23
+ ### 3.8.3 / 2019-10-02
24
+ [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.8.2...v3.8.3)
25
+
26
+ Bug Fixes:
27
+
28
+ * Escape \r when outputting strings inside arrays.
29
+ (Tomita Masahiro, Jon Rowe, #378)
30
+ * Ensure that optional hash arguments are recognised correctly vs keyword
31
+ arguments. (Evgeni Dzhelyov, #366)
32
+
33
+ ### 3.8.2 / 2019-06-10
34
+ [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.8.1...v3.8.2)
35
+
36
+ Bug Fixes:
37
+
38
+ * Ensure that an empty hash is recognised as empty keyword arguments when
39
+ applicable. (Thomas Walpole, #375)
40
+ * Ensure that diffing truthy values produce diffs consistently.
41
+ (Lucas Nestor, #377)
42
+
43
+ ### 3.8.1 / 2019-03-03
44
+ [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.8.0...v3.8.1)
45
+
46
+ Bug Fixes:
47
+
48
+ * Ensure that inspecting a `SimpleDelegator` based object works regardless of
49
+ visibilty of the `__getobj__` method. (Jon Rowe, #369)
50
+
1
51
  ### 3.8.0 / 2018-08-04
2
52
  [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.7.1...v3.8.0)
3
53
 
@@ -139,7 +139,7 @@ module RSpec
139
139
  end
140
140
  end
141
141
 
142
- # The Differ is only needed when a a spec fails with a diffable failure.
142
+ # The Differ is only needed when a spec fails with a diffable failure.
143
143
  # In the more common case of all specs passing or the only failures being
144
144
  # non-diffable, we can avoid the extra cost of loading the differ, diff-lcs,
145
145
  # pp, etc by avoiding an unnecessary require. Instead, autoload will take
@@ -11,7 +11,7 @@ module RSpec
11
11
  def diff(actual, expected)
12
12
  diff = ""
13
13
 
14
- if actual && expected
14
+ unless actual.nil? || expected.nil?
15
15
  if all_strings?(actual, expected)
16
16
  if any_multiline_strings?(actual, expected)
17
17
  diff = diff_as_string(coerce_to_string(actual), coerce_to_string(expected))
@@ -97,7 +97,7 @@ module RSpec
97
97
  if Array === entry
98
98
  entry.inspect
99
99
  else
100
- entry.to_s.gsub("\n", "\\n")
100
+ entry.to_s.gsub("\n", "\\n").gsub("\r", "\\r")
101
101
  end
102
102
  end
103
103
  end
@@ -5,31 +5,11 @@ module RSpec
5
5
  # Reduce allocations by storing constants.
6
6
  UTF_8 = "UTF-8"
7
7
  US_ASCII = "US-ASCII"
8
- #
9
- # In MRI 2.1 'invalid: :replace' changed to also replace an invalid byte sequence
10
- # see https://github.com/ruby/ruby/blob/v2_1_0/NEWS#L176
11
- # https://www.ruby-forum.com/topic/6861247
12
- # https://twitter.com/nalsh/status/553413844685438976
13
- #
14
- # For example, given:
15
- # "\x80".force_encoding("Emacs-Mule").encode(:invalid => :replace).bytes.to_a
16
- #
17
- # On MRI 2.1 or above: 63 # '?'
18
- # else : 128 # "\x80"
19
- #
8
+
20
9
  # Ruby's default replacement string is:
21
10
  # U+FFFD ("\xEF\xBF\xBD"), for Unicode encoding forms, else
22
11
  # ? ("\x3F")
23
12
  REPLACE = "?"
24
- ENCODE_UNCONVERTABLE_BYTES = {
25
- :invalid => :replace,
26
- :undef => :replace,
27
- :replace => REPLACE
28
- }
29
- ENCODE_NO_CONVERTER = {
30
- :invalid => :replace,
31
- :replace => REPLACE
32
- }
33
13
 
34
14
  def initialize(string, encoding=nil)
35
15
  @encoding = encoding
@@ -112,9 +92,25 @@ module RSpec
112
92
  string = remove_invalid_bytes(string)
113
93
  string.encode(@encoding)
114
94
  rescue Encoding::UndefinedConversionError, Encoding::InvalidByteSequenceError
115
- string.encode(@encoding, ENCODE_UNCONVERTABLE_BYTES)
95
+ # Originally defined as a constant to avoid uneeded allocations, this hash must
96
+ # be defined inline (without {}) to avoid warnings on Ruby 2.7
97
+ #
98
+ # In MRI 2.1 'invalid: :replace' changed to also replace an invalid byte sequence
99
+ # see https://github.com/ruby/ruby/blob/v2_1_0/NEWS#L176
100
+ # https://www.ruby-forum.com/topic/6861247
101
+ # https://twitter.com/nalsh/status/553413844685438976
102
+ #
103
+ # For example, given:
104
+ # "\x80".force_encoding("Emacs-Mule").encode(:invalid => :replace).bytes.to_a
105
+ #
106
+ # On MRI 2.1 or above: 63 # '?'
107
+ # else : 128 # "\x80"
108
+ #
109
+ string.encode(@encoding, :invalid => :replace, :undef => :replace, :replace => REPLACE)
116
110
  rescue Encoding::ConverterNotFoundError
117
- string.dup.force_encoding(@encoding).encode(ENCODE_NO_CONVERTER)
111
+ # Originally defined as a constant to avoid uneeded allocations, this hash must
112
+ # be defined inline (without {}) to avoid warnings on Ruby 2.7
113
+ string.dup.force_encoding(@encoding).encode(:invalid => :replace, :replace => REPLACE)
118
114
  end
119
115
 
120
116
  # Prevents raising ArgumentError
@@ -77,14 +77,19 @@ module RSpec
77
77
  given_kw_args - @allowed_kw_args
78
78
  end
79
79
 
80
+ # If the last argument is Hash, Ruby will treat only symbol keys as keyword arguments
81
+ # the rest will be grouped in another Hash and passed as positional argument.
80
82
  def has_kw_args_in?(args)
81
- Hash === args.last && could_contain_kw_args?(args)
83
+ Hash === args.last &&
84
+ could_contain_kw_args?(args) &&
85
+ (args.last.empty? || args.last.keys.any? { |x| x.is_a?(Symbol) })
82
86
  end
83
87
 
84
88
  # Without considering what the last arg is, could it
85
89
  # contain keyword arguments?
86
90
  def could_contain_kw_args?(args)
87
91
  return false if args.count <= min_non_kw_args
92
+
88
93
  @allows_any_kw_args || @allowed_kw_args.any?
89
94
  end
90
95
 
@@ -357,7 +362,14 @@ module RSpec
357
362
 
358
363
  def split_args(*args)
359
364
  kw_args = if @signature.has_kw_args_in?(args)
360
- args.pop.keys
365
+ last = args.pop
366
+ non_kw_args = last.reject { |k, _| k.is_a?(Symbol) }
367
+ if non_kw_args.empty?
368
+ last.keys
369
+ else
370
+ args << non_kw_args
371
+ last.select { |k, _| k.is_a?(Symbol) }.keys
372
+ end
361
373
  else
362
374
  []
363
375
  end
@@ -225,7 +225,7 @@ module RSpec
225
225
  end
226
226
 
227
227
  def inspect
228
- "#<#{object.class}(#{formatter.format(object.__getobj__)})>"
228
+ "#<#{object.class}(#{formatter.format(object.send(:__getobj__))})>"
229
229
  end
230
230
  end
231
231
 
@@ -90,6 +90,15 @@ module RSpec
90
90
  end
91
91
  end
92
92
 
93
+ if RUBY_VERSION.to_f >= 2.7
94
+ def supports_taint?
95
+ false
96
+ end
97
+ else
98
+ def supports_taint?
99
+ true
100
+ end
101
+ end
93
102
  ripper_requirements = [ComparableVersion.new(RUBY_VERSION) >= '1.9.2']
94
103
 
95
104
  ripper_requirements.push(false) if Ruby.rbx?
@@ -59,10 +59,15 @@ module RSpec
59
59
  l =~ %r{bundler/source/rubygems} ||
60
60
  # Ignore bundler + rubygems warning.
61
61
  l =~ %r{site_ruby/\d\.\d\.\d/rubygems} ||
62
+ l =~ %r{jruby-\d\.\d\.\d\.\d/lib/ruby/stdlib/rubygems} ||
62
63
  # This is required for windows for some reason
63
64
  l =~ %r{lib/bundler/rubygems} ||
64
65
  # This is a JRuby file that generates warnings on 9.0.3.0
65
- l =~ %r{lib/ruby/stdlib/jar}
66
+ l =~ %r{lib/ruby/stdlib/jar} ||
67
+ # This is a JRuby file that generates warnings on 9.1.7.0
68
+ l =~ %r{org/jruby/RubyKernel\.java} ||
69
+ # Remove blank lines
70
+ l == "" || l.nil?
66
71
  end.join("\n")
67
72
  end
68
73
 
@@ -38,6 +38,10 @@ module RSpec
38
38
  def write(line)
39
39
  return if line =~ %r{^\S+/gems/\S+:\d+: warning:} # http://rubular.com/r/kqeUIZOfPG
40
40
 
41
+ # Ruby 2.7.0 complains about hashes used in place of keyword arguments
42
+ # Aruba 0.14.2 uses this internally triggering that here
43
+ return if line =~ %r{lib/ruby/2\.7\.0/fileutils\.rb:622: warning:}
44
+
41
45
  @orig_stderr.write(line)
42
46
  @output_tracker.write(line)
43
47
  end
@@ -1,7 +1,7 @@
1
1
  module RSpec
2
2
  module Support
3
3
  module Version
4
- STRING = '3.8.0'
4
+ STRING = '3.9.2'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-support
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.0
4
+ version: 3.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Chelimsky
@@ -48,22 +48,8 @@ cert_chain:
48
48
  ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
49
49
  F3MdtaDehhjC
50
50
  -----END CERTIFICATE-----
51
- date: 2018-08-04 00:00:00.000000000 Z
51
+ date: 2019-12-30 00:00:00.000000000 Z
52
52
  dependencies:
53
- - !ruby/object:Gem::Dependency
54
- name: bundler
55
- requirement: !ruby/object:Gem::Requirement
56
- requirements:
57
- - - "~>"
58
- - !ruby/object:Gem::Version
59
- version: '1.3'
60
- type: :development
61
- prerelease: false
62
- version_requirements: !ruby/object:Gem::Requirement
63
- requirements:
64
- - - "~>"
65
- - !ruby/object:Gem::Version
66
- version: '1.3'
67
53
  - !ruby/object:Gem::Dependency
68
54
  name: rake
69
55
  requirement: !ruby/object:Gem::Requirement
@@ -135,7 +121,12 @@ files:
135
121
  homepage: https://github.com/rspec/rspec-support
136
122
  licenses:
137
123
  - MIT
138
- metadata: {}
124
+ metadata:
125
+ bug_tracker_uri: https://github.com/rspec/rspec-support/issues
126
+ changelog_uri: https://github.com/rspec/rspec-support/blob/v3.9.2/Changelog.md
127
+ documentation_uri: https://rspec.info/documentation/
128
+ mailing_list_uri: https://groups.google.com/forum/#!forum/rspec
129
+ source_code_uri: https://github.com/rspec/rspec-support
139
130
  post_install_message:
140
131
  rdoc_options:
141
132
  - "--charset=UTF-8"
@@ -152,9 +143,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
143
  - !ruby/object:Gem::Version
153
144
  version: '0'
154
145
  requirements: []
155
- rubyforge_project:
156
- rubygems_version: 2.6.13
146
+ rubygems_version: 3.1.2
157
147
  signing_key:
158
148
  specification_version: 4
159
- summary: rspec-support-3.8.0
149
+ summary: rspec-support-3.9.2
160
150
  test_files: []
metadata.gz.sig CHANGED
Binary file