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

Commit c9cefaf

Browse files
committed
add spec for output check
1 parent d7b9f9c commit c9cefaf

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

spec/rspec/core/formatters_spec.rb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,28 @@ module RSpec::Core::Formatters
144144
loader.add :documentation, path
145145
}.to change { loader.formatters.length }
146146
end
147+
148+
context "formatters do not subclass BaseFormatter" do
149+
before do
150+
stub_const("CustomFormatter", Class.new)
151+
stub_const("OtherCustomFormatter", Class.new)
152+
Loader.formatters[CustomFormatter] = []
153+
Loader.formatters[OtherCustomFormatter] = []
154+
loader.add "CustomFormatter"
155+
end
156+
157+
it "adds different formatters" do
158+
expect {
159+
loader.add "OtherCustomFormatter"
160+
}.to change { loader.formatters.length }
161+
end
162+
163+
it "doesn't add the same formatter" do
164+
expect {
165+
loader.add "CustomFormatter"
166+
}.not_to change { loader.formatters.length }
167+
end
168+
end
147169
end
148170

149171
context "When a custom formatter exists" do

0 commit comments

Comments
 (0)