rspec-support 3.6.0 → 3.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +7 -2
- data/Changelog.md +18 -0
- data/lib/rspec/support.rb +10 -0
- data/lib/rspec/support/differ.rb +4 -4
- data/lib/rspec/support/object_formatter.rb +1 -2
- data/lib/rspec/support/recursive_const_methods.rb +1 -1
- data/lib/rspec/support/ruby_features.rb +2 -2
- data/lib/rspec/support/version.rb +1 -1
- data/lib/rspec/support/warnings.rb +2 -2
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97a8c3ef5bd62597387905254a288976a0c64c7a
|
4
|
+
data.tar.gz: b43e05200a5722ac6b8df8f6e34b1e7b2a30804a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb1cfe9e1c326894f7a44d40df99e09ae579a39c2dac9dbe2af2e4996e76521d37bb7950f764f16c6a0c5864c384725042df706b9e22d3476628a0384bf47616
|
7
|
+
data.tar.gz: 8638d927462d2555d0ad2eba87dd5b0abfd3c2379d28430da87d447cccbc0630c75466438b250547994b95da13de042ae688830f109d8d9b6958de8a0ce84faa
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1,2 +1,7 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
�x%�����ᡢ�x�B�v3k�Dx0�p�)�j�ȫ��ty�w�����tg�S��`��7�
|
2
|
+
����\��cFQ�OuT����U��HI`���Eg���_D�j�ӬL�7��b_.�I�Ҳ(�a����x��c�@��`�%a_S�W����D\�Z��R�#�����h�'}z�"|s��TJF[Eص�vUKo/�i)ٖ�
|
3
|
+
d`�N�f1M����'4��.�1^�!`Nz'h��y��
|
4
|
+
��$�e�8�#X��>���)5���'%J�
|
5
|
+
���|�C��աd��I9}�$���<Z�ډ*�����a���H=���m��(�Ic�
|
6
|
+
ߞ�q�He�R*],�v�H�;i�/���������
|
7
|
+
�_��Ns����G����F��Ot�@��3�>4\T�<��i`�.�9����|��y?9p�C�p�]��&�F ]�O"�k,�9�B�T�v�i��< `��+O�Y�L�&�W�9f����*�.���WL���[��d
|
data/Changelog.md
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
### Development
|
2
|
+
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.7.0...master)
|
3
|
+
|
4
|
+
### 3.7.0 / 2017-05-04
|
5
|
+
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.6.0...v3.7.0)
|
6
|
+
|
7
|
+
Enhancements:
|
8
|
+
|
9
|
+
* Improve compatibility with `--enable-frozen-string-literal` option
|
10
|
+
on Ruby 2.3+. (Pat Allan, #320)
|
11
|
+
* Add `Support.class_of` for extracting class of any object.
|
12
|
+
(Yuji Nakayama, #325)
|
13
|
+
|
14
|
+
Bug Fixes:
|
15
|
+
|
16
|
+
* Fix recursive const support to not blow up when given buggy classes
|
17
|
+
that raise odd errors from `#to_str`. (Myron Marston, #317)
|
18
|
+
|
1
19
|
### 3.6.0 / 2017-05-04
|
2
20
|
[Full Changelog](http://github.com/rspec/rspec-support/compare/v3.6.0.beta2...3.6.0)
|
3
21
|
|
data/lib/rspec/support.rb
CHANGED
@@ -73,6 +73,16 @@ module RSpec
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
+
# @api private
|
77
|
+
#
|
78
|
+
# Used internally to get a class of a given object, even if it does not respond to #class.
|
79
|
+
def self.class_of(object)
|
80
|
+
object.class
|
81
|
+
rescue NoMethodError
|
82
|
+
singleton_class = class << object; self; end
|
83
|
+
singleton_class.ancestors.find { |ancestor| !ancestor.equal?(singleton_class) }
|
84
|
+
end
|
85
|
+
|
76
86
|
# A single thread local variable so we don't excessively pollute that namespace.
|
77
87
|
def self.thread_local_data
|
78
88
|
Thread.current[:__rspec] ||= {}
|
data/lib/rspec/support/differ.rb
CHANGED
@@ -181,19 +181,19 @@ module RSpec
|
|
181
181
|
when Hash
|
182
182
|
hash_to_string(object)
|
183
183
|
when Array
|
184
|
-
PP.pp(ObjectFormatter.prepare_for_inspection(object), "")
|
184
|
+
PP.pp(ObjectFormatter.prepare_for_inspection(object), "".dup)
|
185
185
|
when String
|
186
186
|
object =~ /\n/ ? object : object.inspect
|
187
187
|
else
|
188
|
-
PP.pp(object, "")
|
188
|
+
PP.pp(object, "".dup)
|
189
189
|
end
|
190
190
|
end
|
191
191
|
|
192
192
|
def hash_to_string(hash)
|
193
193
|
formatted_hash = ObjectFormatter.prepare_for_inspection(hash)
|
194
194
|
formatted_hash.keys.sort_by { |k| k.to_s }.map do |key|
|
195
|
-
pp_key = PP.singleline_pp(key, "")
|
196
|
-
pp_value = PP.singleline_pp(formatted_hash[key], "")
|
195
|
+
pp_key = PP.singleline_pp(key, "".dup)
|
196
|
+
pp_value = PP.singleline_pp(formatted_hash[key], "".dup)
|
197
197
|
|
198
198
|
"#{pp_key} => #{pp_value},"
|
199
199
|
end.join("\n")
|
@@ -199,8 +199,7 @@ module RSpec
|
|
199
199
|
end
|
200
200
|
|
201
201
|
def klass
|
202
|
-
|
203
|
-
singleton_class.ancestors.find { |ancestor| !ancestor.equal?(singleton_class) }
|
202
|
+
Support.class_of(object)
|
204
203
|
end
|
205
204
|
|
206
205
|
# http://stackoverflow.com/a/2818916
|
@@ -64,7 +64,7 @@ module RSpec
|
|
64
64
|
parts.inject([Object, '']) do |(mod, full_name), name|
|
65
65
|
yield(full_name, name) if block_given? && !(Module === mod)
|
66
66
|
return false unless const_defined_on?(mod, name)
|
67
|
-
[get_const_defined_on(mod, name), [mod, name].join('::')]
|
67
|
+
[get_const_defined_on(mod, name), [mod.name, name].join('::')]
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
@@ -80,9 +80,9 @@ module RSpec
|
|
80
80
|
|
81
81
|
if Ruby.jruby?
|
82
82
|
ripper_requirements.push(Ruby.jruby_version >= '1.7.5')
|
83
|
-
# Ripper on JRuby 9.0.0.0.rc1
|
83
|
+
# Ripper on JRuby 9.0.0.0.rc1 - 9.1.8.0 reports wrong line number
|
84
84
|
# or cannot parse source including `:if`.
|
85
|
-
ripper_requirements.push(Ruby.jruby_version
|
85
|
+
ripper_requirements.push(!Ruby.jruby_version.between?('9.0.0.0.rc1', '9.1.8.0'))
|
86
86
|
end
|
87
87
|
|
88
88
|
if ripper_requirements.all?
|
@@ -28,8 +28,8 @@ module RSpec
|
|
28
28
|
# Used internally to print longer warnings
|
29
29
|
def warn_with(message, options={})
|
30
30
|
call_site = options.fetch(:call_site) { CallerFilter.first_non_rspec_line }
|
31
|
-
message
|
32
|
-
message
|
31
|
+
message += " Use #{options[:replacement]} instead." if options[:replacement]
|
32
|
+
message += " Called from #{call_site}." if call_site
|
33
33
|
Support.warning_notifier.call message
|
34
34
|
end
|
35
35
|
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.
|
4
|
+
version: 3.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Chelimsky
|
@@ -48,7 +48,7 @@ cert_chain:
|
|
48
48
|
ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
|
49
49
|
F3MdtaDehhjC
|
50
50
|
-----END CERTIFICATE-----
|
51
|
-
date: 2017-
|
51
|
+
date: 2017-10-17 00:00:00.000000000 Z
|
52
52
|
dependencies:
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: bundler
|
@@ -153,8 +153,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
153
|
version: '0'
|
154
154
|
requirements: []
|
155
155
|
rubyforge_project:
|
156
|
-
rubygems_version: 2.
|
156
|
+
rubygems_version: 2.6.14
|
157
157
|
signing_key:
|
158
158
|
specification_version: 4
|
159
|
-
summary: rspec-support-3.
|
159
|
+
summary: rspec-support-3.7.0
|
160
160
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|