-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update documentation around fixture paths #48512
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc changes all look good to me! ❤️
I noticed while reviewing that the deprecation messages around the existing fixture_path
methods could use adjusting (e.g. we should use TestFixtures.fixture_path is deprecated
instead of TestFixtures#fixture_path is deprecated
for the class method, the setter message refers to the getter method, etc...), so I'll open a small PR to tweak those.
Since this method has been documented in the guides for ages, it's probably safe. https://guides.rubyonrails.org/testing.html#revenge-of-the-fixtures TODO: I don't like how these methods are documented on ActionMailer::TestCase::Behavior, even though the API is meant to be exposed through ActionMailer::TestCase
This removes the deprecated .fixture_path and .fixture_path= methods from public documentation, and creates a class method for the getter and setters. Interestingly because these methods were always `class_attribute` based, which RDoc doesn't parse, they weren't technically "public" documentation.
These methods are only available when requiring the railties "rails/test_help" file, which is included by default in the test_helper.rb for newly generated Rails applications. Since requiring that file is the only way, and some applications may have removed it or not used test-unit when generating their application, I think it's worth calling out explicitly here.
* Improve the spacing of various paragraphs * Link to AS::TestCase.fixture_paths= API * Add a note about needing to require "rails/test_help" to get fixture_paths * Expanded briefly on YAML default map unordering property * Improve heading weight consistency * Unlink several RDoc autolinked things
This PR makes a couple of changes, so I've broken them down atomically.
Based on what I've found from #47675, there were a couple of improvements to be made.
Please feel free to review them on a per-commit basis, starting:
fixture_paths=
setter now that it's documented, and other small cleanupsPlanning to not merge this one without feedback, since it's changing the public visibility of a method and adding other possibly controversial docs.