File tree 2 files changed +21
-0
lines changed
2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -78,3 +78,18 @@ def is_expected
78
78
end
79
79
end
80
80
end
81
+
82
+ RSpec ::Core ::Formatters ::DeprecationFormatter ::GeneratedDeprecationMessage . class_eval do
83
+ def to_s
84
+ msg = "#{ @data [ :deprecated ] } is deprecated."
85
+ msg += " Use #{ @data [ :replacement ] } instead." if @data [ :replacement ]
86
+ msg += " Called from #{ @data [ :call_site ] } ." if @data [ :call_site ]
87
+ msg
88
+ end
89
+
90
+ def too_many_warnings_message
91
+ msg = "Too many uses of deprecated '#{ type } '."
92
+ msg += " Set config.deprecation_stream to a File for full output."
93
+ msg
94
+ end
95
+ end
Original file line number Diff line number Diff line change 54
54
expect ( Time ) . to receive ( :now ) . once . and_call_original
55
55
Time . now . should be_kind_of ( Time )
56
56
end
57
+
58
+ describe 'stubs' do
59
+ it 'works and displays deprecation' do
60
+ Object . new . stub :foo
61
+ end
62
+ end
57
63
end
You can’t perform that action at this time.
0 commit comments