This repository was archived by the owner on Nov 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ def deprecate(deprecated, options = {})
9
9
#
10
10
# Used internally to print deprecation warnings
11
11
# when rspec-core isn't loaded
12
- def warn_deprecation ( message )
13
- warn_with "DEPRECATION: \n #{ message } "
12
+ def warn_deprecation ( message , options = { } )
13
+ warn_with "DEPRECATION: \n #{ message } " , options
14
14
end
15
15
16
16
# @private
Original file line number Diff line number Diff line change 2
2
require "rspec/support/warnings"
3
3
4
4
describe "rspec warnings and deprecations" do
5
- subject ( :warning_object ) {
6
- Object . new . tap { |o | o . extend ( RSpec ::Support ::Warnings ) }
7
- }
5
+ let ( :warning_object ) do
6
+ Object . new . tap { |o | o . extend ( RSpec ::Support ::Warnings ) }
7
+ end
8
8
9
9
context "when rspec-core is not available" do
10
10
shared_examples_for "falling back to Kernel.warn" do |args |
14
14
expect ( ::Kernel ) . to receive ( :warn ) . with ( /message/ )
15
15
warning_object . send ( method_name , 'message' )
16
16
end
17
+
18
+ it "handles being passed options" do
19
+ expect ( ::Kernel ) . to receive ( :warn ) . with ( /message/ )
20
+ warning_object . send ( method_name , "this is the message" , :type => :test )
21
+ end
17
22
end
18
23
19
24
it_behaves_like 'falling back to Kernel.warn' , :method_name => :deprecate
You can’t perform that action at this time.
0 commit comments