Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 2ecdecc

Browse files
committed
Remove unreachable code.
`RSpec::CallerFilter.first_non_rspec_line` either returns the line or raises an error, so the branch for when `line` is nil could never be reached.
1 parent ad53e7f commit 2ecdecc

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

lib/rspec/core/formatters.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,7 @@ def add(formatter_to_use, *paths)
138138
formatter = RSpec::LegacyFormatters.load_formatter formatter_class, *args
139139
@reporter.register_listener formatter, *formatter.notifications
140140
else
141-
line = ::RSpec::CallerFilter.first_non_rspec_line
142-
if line
143-
call_site = "Formatter added at: #{line}"
144-
else
145-
call_site = "The formatter was added via command line flag or your "\
146-
"`.rspec` file."
147-
end
141+
call_site = "Formatter added at: #{::RSpec::CallerFilter.first_non_rspec_line}"
148142

149143
RSpec.warn_deprecation <<-WARNING.gsub(/\s*\|/, ' ')
150144
|The #{formatter_class} formatter uses the deprecated formatter

0 commit comments

Comments
 (0)