-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If you run tests with Minitest at themoment, but without the environment variable `OPENAPI`, you are greeted with an error message. `undefined method `openapi!' for Api::V0::SomeControllerTest:Class (NoMethodError)` This is because the current code adds the `openapi!` method only if `OPENAPI` environment variable is set. This commit modifies the loading logic, always requiring the `minitest` hooks class to be loaded if `Minitest` constant is defined, to avoid issues with RSpec. Then, the `openapi?` and `openapi!` methods are always prepended to `Minitest::Test`, while the modified `run` method and the `after_run` hook are only activated when `OPENAPI` environment variable is set.
- Loading branch information
Showing
2 changed files
with
14 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters