This repository was archived by the owner on Nov 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +8
-10
lines changed Expand file tree Collapse file tree 3 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ Breaking Changes:
29
29
* Remove deprecated ` PendingExampleFixedNotification ` and
30
30
` PendingExampleFailedAsExpectedNotification ` classes. (Phil Pirozhkov, #2864 )
31
31
* Remove deprecated ` rerun_argument ` example method. (Phil Pirozhkov, #2864 )
32
+ * Raise on attempt to use a legacy formatter without ` rspec-legacy_formatters ` .
33
+ (Phil Pirozhkov, #2864 )
32
34
33
35
Enhancements:
34
36
Original file line number Diff line number Diff line change @@ -160,19 +160,15 @@ def add(formatter_to_use, *paths)
160
160
formatter = RSpec ::LegacyFormatters . load_formatter formatter_class , *args
161
161
register formatter , formatter . notifications
162
162
else
163
- call_site = "Formatter added at: #{ ::RSpec ::CallerFilter . first_non_rspec_line } "
164
-
165
- RSpec . warn_deprecation <<-WARNING . gsub ( /\s *\| / , ' ' )
163
+ raise ArgumentError , <<-ERROR . gsub ( /\s *\| / , ' ' )
166
164
|The #{ formatter_class } formatter uses the deprecated formatter
167
- |interface not supported directly by RSpec 3 .
165
+ |interface not supported directly by RSpec 4 .
168
166
|
169
167
|To continue to use this formatter you must install the
170
168
|`rspec-legacy_formatters` gem, which provides support
171
169
|for legacy formatters or upgrade the formatter to a
172
170
|compatible version.
173
- |
174
- |#{ call_site }
175
- WARNING
171
+ ERROR
176
172
end
177
173
end
178
174
Original file line number Diff line number Diff line change @@ -83,9 +83,9 @@ module RSpec::Core::Formatters
83
83
end
84
84
85
85
it "issues a deprecation" do
86
- expect_warn_deprecation (
87
- /The #{ formatter_class } formatter uses the deprecated formatter interface.+ #{ __FILE__ } : #{ __LINE__ + 1 } / )
88
- loader . add formatter_class , output
86
+ expect {
87
+ loader . add formatter_class , output
88
+ } . to raise_error ( ArgumentError , /The #{ formatter_class } formatter uses the deprecated formatter interface not supported directly by RSpec 4/ )
89
89
end
90
90
end
91
91
You can’t perform that action at this time.
0 commit comments