rspec / rspec-core

RSpec runner and formatters
http://rspec.info
MIT License
1.23k stars 765 forks source link

Skip output check if output not defined on formatter #2916

Closed niceking closed 2 years ago

niceking commented 3 years ago

If a custom formatter doesn't subclass the BaseTextFormatter it doesn't have the output method, then the duplicate formatter check throws a "undefined method output" error, just PR just skips that part of the check if the output method isn't defined.

Also I've noticed in the documentation for custom formatters that the text recommends subclassing from BaseTextFormatter but the example doesn't show that? I totally just read the code and skimmed the text 😛

JonRowe commented 3 years ago

Can you add a spec for this?

niceking commented 3 years ago

Heyo just a bump on this, I added a commit but didn't add a comment so perhaps you didn't see it!! I have no idea what the etiquette is here 🙈

niceking commented 3 years ago

Uhhhhh so I see there's a failing spec on JRuby 1.7....unclear whether this is related to my changes or not? The failing test seems unrelated but it is also inspecting the output so I guess it might be related to my changes 🤷‍♀️

Anyways I attempted to install JRuby 1.7.0 to run the cuces locally and got this fun message:

WARNING: jruby-1.7.0 is past its end of life and is now unsupported.
It no longer receives bug fixes or critical security updates.

And also installation didn't succeed because my version of openjdk (17.0.1) is also too new... At which point I gave up! Not sure how to proceed here? There also doesn't seem to be error message for why the test is failing? Perhaps there is no output string outputted? 🤷‍♀️

pirj commented 3 years ago

No worries on the JRuby 1.7 build, it's known to periodically fail on the bisect scenario, e.g https://github.com/rspec/rspec-core/actions/runs/1416457643

niceking commented 3 years ago

Ok... so does this PR need anything else?

JonRowe commented 2 years ago

Merging despite build failure as its unrelated, thanks @niceking and sorry it took so long to finalise this.