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 +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ def deprecate(deprecated, data = {})
18
18
# @private
19
19
#
20
20
# Used internally to print deprecation warnings
21
- def warn_deprecation ( message )
22
- RSpec . configuration . reporter . deprecation :message => message
21
+ def warn_deprecation ( message , opts = { } )
22
+ RSpec . configuration . reporter . deprecation opts . merge ( :message => message )
23
23
end
24
24
25
25
def warn_with ( message , options = { } )
Original file line number Diff line number Diff line change 24
24
expect ( RSpec . configuration . reporter ) . to receive ( :deprecation ) . with ( hash_including :message => "this is the message" )
25
25
RSpec . warn_deprecation ( "this is the message" )
26
26
end
27
+
28
+ it "passes along additional options" do
29
+ expect ( RSpec . configuration . reporter ) . to receive ( :deprecation ) . with ( hash_including :type => :tag )
30
+ RSpec . warn_deprecation ( "this is the message" , :type => :tag )
31
+ end
27
32
end
28
33
29
34
describe "#warn_with" do
30
35
context "when :use_spec_location_as_call_site => true is passed" do
31
- let ( :options ) {
36
+ let ( :options ) do
32
37
{
33
38
:use_spec_location_as_call_site => true ,
34
39
:call_site => nil ,
35
40
}
36
- }
41
+ end
37
42
38
43
it "adds the source location of spec" do
39
44
line = __LINE__ - 1
You can’t perform that action at this time.
0 commit comments