rspec-expectations 3.0.2 → 3.0.3

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
  SHA1:
3
- metadata.gz: ab0ab80e39aa5fde21f8720bbc62094627a8657f
4
- data.tar.gz: 74ee61900c9df6b0f21746fe417b06067a65e6f6
3
+ metadata.gz: 2b63a1c9a9ef47104ac9e590f2bf2c36fe5a5222
4
+ data.tar.gz: 9cb49a6e9f9dd9c0b4d6468d4a0833c2f39d4f46
5
5
  SHA512:
6
- metadata.gz: 0869ab245a3b41c76cbdeaeb90dc480c29c0efeeb991a917b71d5a8773aec1e481098b308ea1f3eecd417b4ae799bc064e0e8a0d1346fa99b79f35ee46b118b9
7
- data.tar.gz: b98ebf674da13b00db2cd615322dffc97454a720ce585b9cd2311c951e1931b9babfd8e48fa8126932507c94838634aa5eb88a9e07ce4219b9a0b76ffc9771e4
6
+ metadata.gz: b63f7dbcf9ff4cc5657fa3cabe7fb7c75f99d199fbafccf447f0d096fc9be7aec12b241f3b3c6a06985449bd4baa61114590265a4dc50111e579e48eae89f2f3
7
+ data.tar.gz: 9ea99df5cf9d15fb61683e5e194508e3dd38475966c478ac157695c6615c30c92480a8e91256b4153a65e5d8a03c6ba59d85b92014572632b31487a8fdb4f03d
Binary file
data.tar.gz.sig CHANGED
@@ -1,2 +1,4 @@
1
- &T���XV͜Q�fY�|j�Ku٦��8�ʭob5wH�W|g&A�_��vr�"��8�>o�-AkU�z%z�ԉ�kjzNRh�f_y�#�������Rt��>�f�h��-�!P�1��D�y6DV�o��\O��(�ı�Q���aJyrU=a�3��E-T�e���(���h�Y5�
2
- ��x�]��K�"�s�S��$Vg2��j
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��
@@ -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.1...v3.0.0.beta1)
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
- # The legacy `:should` syntax adds the following methods directly to
104
- # `BasicObject` so that they are available off of any object. Note, however,
105
- # that this syntax does not always play nice with delegate/proxy objects.
106
- # We recommend you use the non-monkeypatching `:expect` syntax instead.
107
- class BasicObject
108
- # @method should
109
- # Passes if `matcher` returns true. Available on every `Object`.
110
- # @example
111
- # actual.should eq expected
112
- # actual.should match /expression/
113
- # @param [Matcher]
114
- # matcher
115
- # @param [String] message optional message to display when the expectation fails
116
- # @return [Boolean] true if the expectation succeeds (else raises)
117
- # @note This is only available when you have enabled the `:should` syntax.
118
- # @see RSpec::Matchers
119
-
120
- # @method should_not
121
- # Passes if `matcher` returns false. Available on every `Object`.
122
- # @example
123
- # actual.should_not eq expected
124
- # @param [Matcher]
125
- # matcher
126
- # @param [String] message optional message to display when the expectation fails
127
- # @return [Boolean] false if the negative expectation succeeds (else raises)
128
- # @note This is only available when you have enabled the `:should` syntax.
129
- # @see RSpec::Matchers
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
@@ -2,7 +2,7 @@ module RSpec
2
2
  module Expectations
3
3
  # @private
4
4
  module Version
5
- STRING = '3.0.2'
5
+ STRING = '3.0.3'
6
6
  end
7
7
  end
8
8
  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 uses_generic_implementation_of?(operator) && (matcher = OperatorMatcher.get(@actual.class, operator))
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 uses_generic_implementation_of?(op)
83
- Support.method_handle_for(@actual, op).owner == ::Kernel
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.2
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-06-20 00:00:00.000000000 Z
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.2
206
+ summary: rspec-expectations-3.0.3
207
207
  test_files: []
208
208
  has_rdoc:
metadata.gz.sig CHANGED
Binary file