rspec-expectations 2.13.0 → 2.99.0

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.
Files changed (96) hide show
  1. checksums.yaml +15 -0
  2. data/Changelog.md +204 -23
  3. data/README.md +43 -87
  4. data/features/README.md +10 -10
  5. data/features/built_in_matchers/README.md +41 -41
  6. data/features/built_in_matchers/be.feature +40 -40
  7. data/features/built_in_matchers/be_within.feature +3 -3
  8. data/features/built_in_matchers/expect_change.feature +6 -6
  9. data/features/built_in_matchers/expect_error.feature +2 -2
  10. data/features/built_in_matchers/start_with.feature +1 -1
  11. data/features/built_in_matchers/throw_symbol.feature +11 -11
  12. data/features/built_in_matchers/yield.feature +18 -3
  13. data/features/custom_matchers/define_diffable_matcher.feature +1 -1
  14. data/features/custom_matchers/define_matcher_outside_rspec.feature +6 -6
  15. data/features/custom_matchers/define_matcher_with_fluent_interface.feature +1 -1
  16. data/features/customized_message.feature +1 -1
  17. data/features/diffing.feature +1 -1
  18. data/features/step_definitions/additional_cli_steps.rb +10 -0
  19. data/features/support/env.rb +10 -1
  20. data/features/support/rubinius.rb +6 -0
  21. data/features/syntax_configuration.feature +3 -0
  22. data/features/test_frameworks/test_unit.feature +55 -17
  23. data/lib/rspec/expectations/caller_filter.rb +60 -0
  24. data/lib/rspec/{matchers → expectations}/configuration.rb +5 -3
  25. data/lib/rspec/expectations/deprecation.rb +20 -31
  26. data/lib/rspec/expectations/differ.rb +48 -9
  27. data/lib/rspec/expectations/expectation_target.rb +81 -15
  28. data/lib/rspec/expectations/extensions/object.rb +2 -12
  29. data/lib/rspec/expectations/fail_with.rb +11 -1
  30. data/lib/rspec/expectations/handler.rb +16 -7
  31. data/lib/rspec/expectations/syntax.rb +5 -7
  32. data/lib/rspec/expectations/version.rb +1 -1
  33. data/lib/rspec/expectations.rb +28 -2
  34. data/lib/rspec/matchers/be_close.rb +4 -1
  35. data/lib/rspec/matchers/built_in/base_matcher.rb +17 -10
  36. data/lib/rspec/matchers/built_in/be.rb +69 -32
  37. data/lib/rspec/matchers/built_in/be_within.rb +9 -3
  38. data/lib/rspec/matchers/built_in/change.rb +49 -3
  39. data/lib/rspec/matchers/built_in/has.rb +40 -7
  40. data/lib/rspec/matchers/built_in/have.rb +170 -5
  41. data/lib/rspec/matchers/built_in/include.rb +3 -11
  42. data/lib/rspec/matchers/built_in/match.rb +5 -0
  43. data/lib/rspec/matchers/built_in/match_array.rb +1 -1
  44. data/lib/rspec/matchers/built_in/raise_error.rb +34 -8
  45. data/lib/rspec/matchers/built_in/respond_to.rb +7 -1
  46. data/lib/rspec/matchers/built_in/satisfy.rb +7 -1
  47. data/lib/rspec/matchers/built_in/throw_symbol.rb +10 -2
  48. data/lib/rspec/matchers/built_in/yield.rb +102 -5
  49. data/lib/rspec/matchers/built_in.rb +2 -2
  50. data/lib/rspec/matchers/differentiate_block_method_types.rb +55 -0
  51. data/lib/rspec/matchers/dsl.rb +2 -1
  52. data/lib/rspec/matchers/match_aliases.rb +22 -0
  53. data/lib/rspec/matchers/matcher.rb +131 -10
  54. data/lib/rspec/matchers/operator_matcher.rb +70 -66
  55. data/lib/rspec/matchers/pretty.rb +11 -1
  56. data/lib/rspec/matchers/test_unit_integration.rb +28 -0
  57. data/lib/rspec/matchers.rb +175 -146
  58. data/lib/rspec-expectations.rb +5 -0
  59. data/spec/rspec/{matchers → expectations}/configuration_spec.rb +78 -91
  60. data/spec/rspec/expectations/differ_spec.rb +65 -6
  61. data/spec/rspec/expectations/expectation_target_spec.rb +72 -3
  62. data/spec/rspec/expectations/extensions/kernel_spec.rb +9 -5
  63. data/spec/rspec/expectations/fail_with_spec.rb +19 -0
  64. data/spec/rspec/expectations/handler_spec.rb +43 -22
  65. data/spec/rspec/expectations/syntax_spec.rb +51 -9
  66. data/spec/rspec/expectations_spec.rb +71 -0
  67. data/spec/rspec/matchers/base_matcher_spec.rb +33 -18
  68. data/spec/rspec/matchers/be_close_spec.rb +9 -6
  69. data/spec/rspec/matchers/be_spec.rb +146 -45
  70. data/spec/rspec/matchers/be_within_spec.rb +8 -0
  71. data/spec/rspec/matchers/change_spec.rb +107 -7
  72. data/spec/rspec/matchers/description_generation_spec.rb +38 -20
  73. data/spec/rspec/matchers/differentiate_block_method_types_spec.rb +39 -0
  74. data/spec/rspec/matchers/eq_spec.rb +1 -1
  75. data/spec/rspec/matchers/equal_spec.rb +26 -0
  76. data/spec/rspec/matchers/exist_spec.rb +9 -9
  77. data/spec/rspec/matchers/has_spec.rb +25 -1
  78. data/spec/rspec/matchers/have_spec.rb +411 -3
  79. data/spec/rspec/matchers/include_matcher_integration_spec.rb +2 -2
  80. data/spec/rspec/matchers/include_spec.rb +4 -4
  81. data/spec/rspec/matchers/match_array_spec.rb +1 -1
  82. data/spec/rspec/matchers/match_spec.rb +14 -1
  83. data/spec/rspec/matchers/matcher_spec.rb +213 -24
  84. data/spec/rspec/matchers/operator_matcher_spec.rb +56 -8
  85. data/spec/rspec/matchers/pretty_spec.rb +23 -0
  86. data/spec/rspec/matchers/raise_error_spec.rb +242 -102
  87. data/spec/rspec/matchers/respond_to_spec.rb +4 -4
  88. data/spec/rspec/matchers/satisfy_spec.rb +1 -1
  89. data/spec/rspec/matchers/start_with_end_with_spec.rb +2 -2
  90. data/spec/rspec/matchers/throw_symbol_spec.rb +14 -14
  91. data/spec/rspec/matchers/yield_spec.rb +81 -4
  92. data/spec/spec_helper.rb +5 -3
  93. data/spec/support/helper_methods.rb +42 -0
  94. data/spec/support/shared_examples.rb +42 -0
  95. metadata +40 -44
  96. data/spec/rspec/matchers/matchers_spec.rb +0 -37
@@ -1,4 +1,5 @@
1
1
  require 'set'
2
+ require 'rspec/matchers/differentiate_block_method_types'
2
3
 
3
4
  module RSpec
4
5
  module Matchers
@@ -10,8 +11,7 @@ module RSpec
10
11
  include RSpec::Matchers::Pretty
11
12
  include RSpec::Matchers
12
13
 
13
- attr_reader :expected, :actual, :rescued_exception
14
- attr_accessor :matcher_execution_context
14
+ attr_reader :actual, :rescued_exception
15
15
 
16
16
  # @api private
17
17
  def initialize(name, &declarations)
@@ -19,17 +19,50 @@ module RSpec
19
19
  @declarations = declarations
20
20
  @actual = nil
21
21
  @diffable = false
22
+ @supports_block_expectations = false
22
23
  @expected_exception, @rescued_exception = nil, nil
23
24
  @match_for_should_not_block = nil
24
25
  @messages = {}
26
+ @define_block_executed = false
27
+ @block_method_differentiator = nil
28
+ @deprecated_methods = Set.new
29
+ @matcher_execution_context = nil
25
30
  end
26
31
 
27
32
  PERSISTENT_INSTANCE_VARIABLES = [
28
33
  :@name, :@declarations, :@diffable,
34
+ :@supports_block_expectations,
29
35
  :@match_block, :@match_for_should_not_block,
30
36
  :@expected_exception
31
37
  ].to_set
32
38
 
39
+ def expected
40
+ if @expected.size == 1
41
+ RSpec.warn_deprecation(
42
+ "Custom matchers in 3.x will set expected to be a single value "+
43
+ "(when provided as such) rather than an array. This may change "+
44
+ "the behaviour of your matcher.\n"+
45
+ "To continue to access this as an array use `expected_array`\n"+
46
+ "Called from: #{ RSpec::CallerFilter.first_non_rspec_line }\n\n"
47
+ )
48
+ end
49
+ @expected
50
+ end
51
+
52
+ def expected_as_array
53
+ @expected
54
+ end
55
+
56
+ def matcher_execution_context=(value)
57
+ RSpec.deprecate("`matcher_execution_context=` on custom matchers")
58
+ @matcher_execution_context = value
59
+ end
60
+
61
+ def matcher_execution_context
62
+ RSpec.deprecate("`matcher_execution_context` on custom matchers")
63
+ @matcher_execution_context
64
+ end
65
+
33
66
  # @api private
34
67
  def for_expected(*expected)
35
68
  @expected = expected
@@ -38,9 +71,14 @@ module RSpec
38
71
  instance_variable_set(ivar, nil) unless (PERSISTENT_INSTANCE_VARIABLES + [:@expected]).include?(ivar)
39
72
  end
40
73
  @messages = {}
74
+ @deprecated_methods = Set.new
75
+
76
+ @block_method_differentiator = DifferentiateBlockMethodTypes.new(*@expected, &@declarations)
41
77
  making_declared_methods_public do
42
78
  instance_eval_with_args(*@expected, &@declarations)
43
79
  end
80
+
81
+ @define_block_executed = true
44
82
  self
45
83
  end
46
84
  end
@@ -183,6 +221,10 @@ module RSpec
183
221
  @diffable = true
184
222
  end
185
223
 
224
+ def supports_block_expectations
225
+ @supports_block_expectations = true
226
+ end
227
+
186
228
  # Convenience for defining methods on this matcher to create a fluent
187
229
  # interface. The trick about fluent interfaces is that each method must
188
230
  # return self in order to chain methods together. `chain` handles that
@@ -214,6 +256,11 @@ module RSpec
214
256
  @diffable
215
257
  end
216
258
 
259
+ # @api private
260
+ def supports_block_expectations?
261
+ @supports_block_expectations
262
+ end
263
+
217
264
  # @api private
218
265
  # Used internally by +should_not+
219
266
  def does_not_match?(actual)
@@ -224,21 +271,51 @@ module RSpec
224
271
  end
225
272
 
226
273
  def respond_to?(method, include_private=false)
227
- super || matcher_execution_context.respond_to?(method, include_private)
274
+ super || @matcher_execution_context.respond_to?(method, include_private)
228
275
  end
229
276
 
230
277
  private
231
278
 
232
279
  def method_missing(method, *args, &block)
233
- if matcher_execution_context.respond_to?(method)
234
- matcher_execution_context.__send__ method, *args, &block
280
+ if @matcher_execution_context.respond_to?(method)
281
+ @matcher_execution_context.__send__ method, *args, &block
235
282
  else
236
283
  super(method, *args, &block)
237
284
  end
238
285
  end
239
286
 
240
- def include(*args)
241
- singleton_class.__send__(:include, *args)
287
+ def include(*modules)
288
+ return_value = singleton_class.__send__(:include, *modules)
289
+
290
+ modules.each do |mod|
291
+ mod.instance_methods.each do |name|
292
+ add_deprecation_warning_to(name,
293
+ "Calling a helper method (`#{name}`) from a module included in a custom matcher as a macro",
294
+ "`extend #{mod.name || "TheModule"}`",
295
+ "included in the custom matcher",
296
+ :unless
297
+ )
298
+ end
299
+ end
300
+
301
+ return_value
302
+ end
303
+
304
+ def extend(*modules)
305
+ return_value = super
306
+
307
+ modules.each do |mod|
308
+ mod.instance_methods.each do |name|
309
+ add_deprecation_warning_to(name,
310
+ "Calling a helper method (`#{name}`) from a module extended onto a custom matcher",
311
+ "`include #{mod.name || "TheModule"}`",
312
+ "extended onto the custom matcher",
313
+ :if
314
+ )
315
+ end
316
+ end unless @define_block_executed
317
+
318
+ return_value
242
319
  end
243
320
 
244
321
  def define_method(name, &block)
@@ -278,15 +355,15 @@ module RSpec
278
355
  end
279
356
 
280
357
  def default_description
281
- "#{name_to_sentence}#{expected_to_sentence}"
358
+ "#{name_to_sentence}#{to_sentence expected_as_array}"
282
359
  end
283
360
 
284
361
  def default_failure_message_for_should
285
- "expected #{actual.inspect} to #{name_to_sentence}#{expected_to_sentence}"
362
+ "expected #{actual.inspect} to #{name_to_sentence}#{to_sentence expected_as_array}"
286
363
  end
287
364
 
288
365
  def default_failure_message_for_should_not
289
- "expected #{actual.inspect} not to #{name_to_sentence}#{expected_to_sentence}"
366
+ "expected #{actual.inspect} not to #{name_to_sentence}#{to_sentence expected_as_array}"
290
367
  end
291
368
 
292
369
  unless method_defined?(:singleton_class)
@@ -294,6 +371,50 @@ module RSpec
294
371
  class << self; self; end
295
372
  end
296
373
  end
374
+
375
+ def singleton_method_added(name)
376
+ return unless @block_method_differentiator
377
+
378
+ if @block_method_differentiator.instance_methods.include?(name)
379
+ add_deprecation_warning_to(name,
380
+ "Calling a helper method (`#{name}`) defined as an instance method (using `def #{name}`) as a macro from a custom matcher `define` block",
381
+ "`def self.#{name}` (to define it as a singleton method)",
382
+ "defined in the custom matcher definition block",
383
+ :unless
384
+ )
385
+ elsif @block_method_differentiator.singleton_methods.include?(name)
386
+ add_deprecation_warning_to(name,
387
+ "Calling a helper method (`#{name}`) defined as a singleton method (using `def self.#{name}`) on a custom matcher",
388
+ "`def #{name}` (to define it as an instance method)",
389
+ "defined in the custom matcher definition block",
390
+ :if
391
+ )
392
+ end
393
+ end
394
+
395
+ def add_deprecation_warning_to(method_name, msg, replacement, extra_call_site_msg, condition)
396
+ return if @deprecated_methods.include?(method_name)
397
+ @deprecated_methods << method_name
398
+
399
+ aliased_name = aliased_name_for(method_name)
400
+ singleton_class.__send__(:alias_method, aliased_name, method_name)
401
+
402
+ singleton_class.class_eval(<<-EOS, __FILE__, __LINE__ + 1)
403
+ def #{method_name}(*a, &b)
404
+ ::RSpec.deprecate(#{msg.inspect},
405
+ :replacement => #{replacement.inspect},
406
+ :call_site => CallerFilter.first_non_rspec_line + " and #{extra_call_site_msg} at #{CallerFilter.first_non_rspec_line}"
407
+ ) #{condition} @define_block_executed
408
+
409
+ __send__(#{aliased_name.inspect}, *a, &b)
410
+ end
411
+ EOS
412
+ end
413
+
414
+ def aliased_name_for(method_name)
415
+ target, punctuation = method_name.to_s.sub(/([?!=])$/, ''), $1
416
+ "#{target}_without_rspec_deprecation_warning#{punctuation}"
417
+ end
297
418
  end
298
419
  end
299
420
  end
@@ -1,97 +1,101 @@
1
1
  module RSpec
2
2
  module Matchers
3
- class OperatorMatcher
4
- class << self
5
- def registry
6
- @registry ||= {}
7
- end
3
+ module BuiltIn
4
+ class OperatorMatcher
5
+ class << self
6
+ def registry
7
+ @registry ||= {}
8
+ end
8
9
 
9
- def register(klass, operator, matcher)
10
- registry[klass] ||= {}
11
- registry[klass][operator] = matcher
12
- end
10
+ def register(klass, operator, matcher)
11
+ registry[klass] ||= {}
12
+ registry[klass][operator] = matcher
13
+ end
13
14
 
14
- def unregister(klass, operator)
15
- registry[klass] && registry[klass].delete(operator)
16
- end
15
+ def unregister(klass, operator)
16
+ registry[klass] && registry[klass].delete(operator)
17
+ end
17
18
 
18
- def get(klass, operator)
19
- klass.ancestors.each { |ancestor|
20
- matcher = registry[ancestor] && registry[ancestor][operator]
21
- return matcher if matcher
22
- }
19
+ def get(klass, operator)
20
+ klass.ancestors.each { |ancestor|
21
+ matcher = registry[ancestor] && registry[ancestor][operator]
22
+ return matcher if matcher
23
+ }
23
24
 
24
- nil
25
+ nil
26
+ end
25
27
  end
26
- end
27
28
 
28
- def initialize(actual)
29
- @actual = actual
30
- end
29
+ def initialize(actual)
30
+ @actual = actual
31
+ end
31
32
 
32
- def self.use_custom_matcher_or_delegate(operator)
33
- define_method(operator) do |expected|
34
- if uses_generic_implementation_of?(operator) && matcher = OperatorMatcher.get(@actual.class, operator)
35
- @actual.__send__(::RSpec::Matchers.last_should, matcher.new(expected))
36
- else
37
- eval_match(@actual, operator, expected)
33
+ def self.use_custom_matcher_or_delegate(operator)
34
+ define_method(operator) do |expected|
35
+ if uses_generic_implementation_of?(operator) && matcher = OperatorMatcher.get(@actual.class, operator)
36
+ @actual.__send__(::RSpec::Matchers.last_should, matcher.new(expected))
37
+ else
38
+ eval_match(@actual, operator, expected)
39
+ end
38
40
  end
39
- end
40
41
 
41
- negative_operator = operator.sub(/^=/, '!')
42
- if negative_operator != operator && respond_to?(negative_operator)
43
- define_method(negative_operator) do |expected|
44
- opposite_should = ::RSpec::Matchers.last_should == :should ? :should_not : :should
45
- raise "RSpec does not support `#{::RSpec::Matchers.last_should} #{negative_operator} expected`. " +
46
- "Use `#{opposite_should} #{operator} expected` instead."
42
+ negative_operator = operator.sub(/^=/, '!')
43
+ if negative_operator != operator && respond_to?(negative_operator)
44
+ define_method(negative_operator) do |expected|
45
+ opposite_should = ::RSpec::Matchers.last_should == :should ? :should_not : :should
46
+ raise "RSpec does not support `#{::RSpec::Matchers.last_should} #{negative_operator} expected`. " +
47
+ "Use `#{opposite_should} #{operator} expected` instead."
48
+ end
47
49
  end
48
50
  end
49
- end
50
51
 
51
- ['==', '===', '=~', '>', '>=', '<', '<='].each do |operator|
52
- use_custom_matcher_or_delegate operator
53
- end
52
+ ['==', '===', '=~', '>', '>=', '<', '<='].each do |operator|
53
+ use_custom_matcher_or_delegate operator
54
+ end
54
55
 
55
- def fail_with_message(message)
56
- RSpec::Expectations.fail_with(message, @expected, @actual)
57
- end
56
+ def fail_with_message(message)
57
+ RSpec::Expectations.fail_with(message, @expected, @actual)
58
+ end
58
59
 
59
- def description
60
- "#{@operator} #{@expected.inspect}"
61
- end
60
+ def description
61
+ "#{@operator} #{@expected.inspect}"
62
+ end
62
63
 
63
64
  private
64
65
 
65
- if Method.method_defined?(:owner) # 1.8.6 lacks Method#owner :-(
66
- def uses_generic_implementation_of?(op)
67
- @actual.method(op).owner == ::Kernel
68
- end
69
- else
70
- def uses_generic_implementation_of?(op)
71
- # This is a bit of a hack, but:
72
- #
73
- # {}.method(:=~).to_s # => "#<Method: Hash(Kernel)#=~>"
74
- #
75
- # In the absence of Method#owner, this is the best we
76
- # can do to see if the method comes from Kernel.
77
- @actual.method(op).to_s.include?('(Kernel)')
66
+ if Method.method_defined?(:owner) # 1.8.6 lacks Method#owner :-(
67
+ def uses_generic_implementation_of?(op)
68
+ Expectations.method_handle_for(@actual, op).owner == ::Kernel
69
+ rescue NameError
70
+ false
71
+ end
72
+ else
73
+ def uses_generic_implementation_of?(op)
74
+ # This is a bit of a hack, but:
75
+ #
76
+ # {}.method(:=~).to_s # => "#<Method: Hash(Kernel)#=~>"
77
+ #
78
+ # In the absence of Method#owner, this is the best we
79
+ # can do to see if the method comes from Kernel.
80
+ Expectations.method_handle_for(@actual, op).to_s.include?('(Kernel)')
81
+ rescue NameError
82
+ false
83
+ end
78
84
  end
79
- end
80
85
 
81
- def eval_match(actual, operator, expected)
82
- ::RSpec::Matchers.last_matcher = self
83
- @operator, @expected = operator, expected
84
- __delegate_operator(actual, operator, expected)
86
+ def eval_match(actual, operator, expected)
87
+ ::RSpec::Matchers.last_matcher = self
88
+ @operator, @expected = operator, expected
89
+ __delegate_operator(actual, operator, expected)
90
+ end
85
91
  end
86
- end
87
92
 
88
- module BuiltIn
89
93
  class PositiveOperatorMatcher < OperatorMatcher
90
94
  def __delegate_operator(actual, operator, expected)
91
95
  if actual.__send__(operator, expected)
92
96
  true
93
97
  elsif ['==','===', '=~'].include?(operator)
94
- fail_with_message("expected: #{expected.inspect}\n got: #{actual.inspect} (using #{operator})")
98
+ fail_with_message("expected: #{expected.inspect}\n got: #{actual.inspect} (using #{operator})")
95
99
  else
96
100
  fail_with_message("expected: #{operator} #{expected.inspect}\n got: #{operator.gsub(/./, ' ')} #{actual.inspect}")
97
101
  end
@@ -21,6 +21,8 @@ module RSpec
21
21
  end
22
22
 
23
23
  def _pretty_print(array)
24
+ RSpec.deprecate("`RSpec::Matchers::Pretty#_pretty_print`",
25
+ :replacement => "`RSpec::Matchers::Pretty#to_sentence`")
24
26
  result = ""
25
27
  array.each_with_index do |item, index|
26
28
  if index < (array.length - 2)
@@ -35,7 +37,7 @@ module RSpec
35
37
  end
36
38
 
37
39
  def to_word(item)
38
- item.respond_to?(:description) ? item.description : item.inspect
40
+ is_matcher_with_description?(item) ? item.description : item.inspect
39
41
  end
40
42
 
41
43
  def name_to_sentence
@@ -43,6 +45,8 @@ module RSpec
43
45
  end
44
46
 
45
47
  def expected_to_sentence
48
+ RSpec.deprecate("`RSpec::Matchers::Pretty#expected_to_sentence`",
49
+ :replacement => "`RSpec::Matchers::Pretty#to_sentence(expected)`")
46
50
  to_sentence(@expected) if defined?(@expected)
47
51
  end
48
52
 
@@ -59,6 +63,12 @@ module RSpec
59
63
  word.downcase!
60
64
  word
61
65
  end
66
+
67
+ private
68
+
69
+ def is_matcher_with_description?(object)
70
+ RSpec::Matchers.is_a_matcher?(object) && object.respond_to?(:description)
71
+ end
62
72
  end
63
73
  end
64
74
  end
@@ -0,0 +1,28 @@
1
+ # Include Matchers for other test frameworks. Note that MiniTest _must_
2
+ # come before TU because on ruby 1.9, T::U::TC is a subclass of MT::U::TC
3
+ # and a 1.9 bug can lead to infinite recursion from the `super` call in our
4
+ # method_missing hook. See this gist for more info:
5
+ # https://gist.github.com/845896
6
+ if defined?(MiniTest::TestCase)
7
+ MiniTest::TestCase.add_setup_hook do |instance|
8
+ unless ::RSpec::Matchers === instance
9
+ ::RSpec.deprecate("rspec-expectations' built-in integration with minitest < 5.x",
10
+ :replacement => "`include RSpec::Matchers` from within `Minitest::TestCase`")
11
+
12
+ MiniTest::TestCase.send(:include, RSpec::Matchers)
13
+ end
14
+ end
15
+ elsif defined?(Test::Unit::TestCase)
16
+ Test::Unit::TestCase.class_eval do
17
+ def setup
18
+ unless ::RSpec::Matchers === self
19
+ ::RSpec.deprecate("rspec-expectations' built-in integration with Test::Unit",
20
+ :replacement => "`include RSpec::Matchers` from within `Test::Unit::TestCase`")
21
+
22
+ Test::Unit::TestCase.send(:include, RSpec::Matchers)
23
+ end
24
+
25
+ super if defined?(super)
26
+ end
27
+ end
28
+ end