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

Commit 47eb66c

Browse files
committed
skip output check if output not defined on formatter
1 parent d57c371 commit 47eb66c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/rspec/core/formatters.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ def register(formatter, notifications)
194194

195195
def duplicate_formatter_exists?(new_formatter)
196196
@formatters.any? do |formatter|
197-
formatter.class == new_formatter.class && formatter.output == new_formatter.output
197+
formatter.class == new_formatter.class &&
198+
formatter.respond_to?(:output) == new_formatter.respond_to?(:output) &&
199+
(formatter.respond_to?(:output) ? formatter.output == new_formatter.output : true)
198200
end
199201
end
200202

0 commit comments

Comments
 (0)