rspec-expectations 3.0.2 → 3.0.3
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +4 -2
- data/Changelog.md +23 -1
- data/lib/rspec/expectations/syntax.rb +29 -27
- data/lib/rspec/expectations/version.rb +1 -1
- data/lib/rspec/matchers/built_in/include.rb +9 -2
- data/lib/rspec/matchers/built_in/operators.rb +3 -3
- metadata +3 -3
- 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: 2b63a1c9a9ef47104ac9e590f2bf2c36fe5a5222
|
4
|
+
data.tar.gz: 9cb49a6e9f9dd9c0b4d6468d4a0833c2f39d4f46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b63f7dbcf9ff4cc5657fa3cabe7fb7c75f99d199fbafccf447f0d096fc9be7aec12b241f3b3c6a06985449bd4baa61114590265a4dc50111e579e48eae89f2f3
|
7
|
+
data.tar.gz: 9ea99df5cf9d15fb61683e5e194508e3dd38475966c478ac157695c6615c30c92480a8e91256b4153a65e5d8a03c6ba59d85b92014572632b31487a8fdb4f03d
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1,2 +1,4 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
N&Z}4�@�6sd�^����� ˅ 0Ж���-
|
2
|
+
o��:��W*�"�S��9U,��;`Ĵ< B��F5���4�3u�BJ�Ѵ\�E��GY=�l 1��\�*fo�v��j�^�r
|
3
|
+
���y+��<��#`��ekf�{���?ny�08)��;�_��:��4�'-����ן�����q>�V2���&>�����3Dݍy��� n�i{�h����@�
|
4
|
+
��`M�$���t���h��
|
data/Changelog.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
### 3.0.3 / 2014-07-21
|
2
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.0.2...v3.0.3)
|
3
|
+
|
4
|
+
Bug Fixes:
|
5
|
+
|
6
|
+
* Fix issue with detection of generic operator matchers so they work
|
7
|
+
correctly when undefined. (Myron Marston, #597)
|
8
|
+
* Don't inadvertently define `BasicObject` in 1.8.7. (Chris Griego, #603)
|
9
|
+
* Fix `include` matcher so that it fails gracefully when matched against
|
10
|
+
an object that does not respond to `include?`. (Myron Marston, #607)
|
11
|
+
|
1
12
|
### 3.0.2 / 2014-06-19
|
2
13
|
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.0.1...v3.0.2)
|
3
14
|
|
@@ -182,7 +193,7 @@ Deprecations:
|
|
182
193
|
a deprecation warning. (Myron Marston)
|
183
194
|
|
184
195
|
### 3.0.0.beta1 / 2013-11-07
|
185
|
-
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.99.
|
196
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.99.2...v3.0.0.beta1)
|
186
197
|
|
187
198
|
Breaking Changes for 3.0.0:
|
188
199
|
|
@@ -230,6 +241,17 @@ Deprecations:
|
|
230
241
|
It will continue to work but will emit a deprecation warning in RSpec 3 if
|
231
242
|
you do not explicitly enable it. (Sam Phippen)
|
232
243
|
|
244
|
+
### 2.99.2 / 2014-07-21
|
245
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.99.1...2-99-maintenance)
|
246
|
+
|
247
|
+
Bug Fixes:
|
248
|
+
|
249
|
+
* Fix regression in `Expectations#method_handle_for` where proxy objects
|
250
|
+
with method delegated would wrongly not return a method handle.
|
251
|
+
(Jon Rowe, #594)
|
252
|
+
* Fix issue with detection of generic operator matchers so they work
|
253
|
+
correctly when undefined. (Myron Marston, #597)
|
254
|
+
|
233
255
|
### 2.99.1 / 2014-06-19
|
234
256
|
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.99.0...v2.99.1)
|
235
257
|
|
@@ -100,31 +100,33 @@ module RSpec
|
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
103
|
-
|
104
|
-
#
|
105
|
-
# that
|
106
|
-
#
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
103
|
+
if defined?(BasicObject)
|
104
|
+
# The legacy `:should` syntax adds the following methods directly to
|
105
|
+
# `BasicObject` so that they are available off of any object. Note, however,
|
106
|
+
# that this syntax does not always play nice with delegate/proxy objects.
|
107
|
+
# We recommend you use the non-monkeypatching `:expect` syntax instead.
|
108
|
+
class BasicObject
|
109
|
+
# @method should
|
110
|
+
# Passes if `matcher` returns true. Available on every `Object`.
|
111
|
+
# @example
|
112
|
+
# actual.should eq expected
|
113
|
+
# actual.should match /expression/
|
114
|
+
# @param [Matcher]
|
115
|
+
# matcher
|
116
|
+
# @param [String] message optional message to display when the expectation fails
|
117
|
+
# @return [Boolean] true if the expectation succeeds (else raises)
|
118
|
+
# @note This is only available when you have enabled the `:should` syntax.
|
119
|
+
# @see RSpec::Matchers
|
120
|
+
|
121
|
+
# @method should_not
|
122
|
+
# Passes if `matcher` returns false. Available on every `Object`.
|
123
|
+
# @example
|
124
|
+
# actual.should_not eq expected
|
125
|
+
# @param [Matcher]
|
126
|
+
# matcher
|
127
|
+
# @param [String] message optional message to display when the expectation fails
|
128
|
+
# @return [Boolean] false if the negative expectation succeeds (else raises)
|
129
|
+
# @note This is only available when you have enabled the `:should` syntax.
|
130
|
+
# @see RSpec::Matchers
|
131
|
+
end
|
130
132
|
end
|
@@ -33,13 +33,13 @@ module RSpec
|
|
33
33
|
# @api private
|
34
34
|
# @return [String]
|
35
35
|
def failure_message
|
36
|
-
improve_hash_formatting(super)
|
36
|
+
improve_hash_formatting(super) + invalid_type_message
|
37
37
|
end
|
38
38
|
|
39
39
|
# @api private
|
40
40
|
# @return [String]
|
41
41
|
def failure_message_when_negated
|
42
|
-
improve_hash_formatting(super)
|
42
|
+
improve_hash_formatting(super) + invalid_type_message
|
43
43
|
end
|
44
44
|
|
45
45
|
# @api private
|
@@ -50,7 +50,14 @@ module RSpec
|
|
50
50
|
|
51
51
|
private
|
52
52
|
|
53
|
+
def invalid_type_message
|
54
|
+
return '' if actual.respond_to?(:include?)
|
55
|
+
", but it does not respond to `include?`"
|
56
|
+
end
|
57
|
+
|
53
58
|
def perform_match(predicate, hash_subset_predicate)
|
59
|
+
return false unless actual.respond_to?(:include?)
|
60
|
+
|
54
61
|
expected.__send__(predicate) do |expected_item|
|
55
62
|
if comparing_hash_to_a_subset?(expected_item)
|
56
63
|
expected_item.__send__(hash_subset_predicate) do |(key, value)|
|
@@ -45,7 +45,7 @@ module RSpec
|
|
45
45
|
# @private
|
46
46
|
def self.use_custom_matcher_or_delegate(operator)
|
47
47
|
define_method(operator) do |expected|
|
48
|
-
if
|
48
|
+
if !has_non_generic_implementation_of?(operator) && (matcher = OperatorMatcher.get(@actual.class, operator))
|
49
49
|
@actual.__send__(::RSpec::Matchers.last_expectation_handler.should_method, matcher.new(expected))
|
50
50
|
else
|
51
51
|
eval_match(@actual, operator, expected)
|
@@ -79,8 +79,8 @@ module RSpec
|
|
79
79
|
|
80
80
|
private
|
81
81
|
|
82
|
-
def
|
83
|
-
Support.method_handle_for(@actual, op).owner
|
82
|
+
def has_non_generic_implementation_of?(op)
|
83
|
+
Support.method_handle_for(@actual, op).owner != ::Kernel
|
84
84
|
rescue NameError
|
85
85
|
false
|
86
86
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-expectations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Baker
|
@@ -33,7 +33,7 @@ cert_chain:
|
|
33
33
|
1yHC1AcSYpvi2dAbOiHT5iQF+krm4wse8KctXgTNnjMsHEoGKulJS2/sZl90jcCz
|
34
34
|
muA=
|
35
35
|
-----END CERTIFICATE-----
|
36
|
-
date: 2014-
|
36
|
+
date: 2014-07-21 00:00:00.000000000 Z
|
37
37
|
dependencies:
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: rspec-support
|
@@ -203,6 +203,6 @@ rubyforge_project: rspec
|
|
203
203
|
rubygems_version: 2.2.2
|
204
204
|
signing_key:
|
205
205
|
specification_version: 4
|
206
|
-
summary: rspec-expectations-3.0.
|
206
|
+
summary: rspec-expectations-3.0.3
|
207
207
|
test_files: []
|
208
208
|
has_rdoc:
|
metadata.gz.sig
CHANGED
Binary file
|