-
-
Notifications
You must be signed in to change notification settings - Fork 909
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Enhance unit test helpers loading (#1585)
This commit refactors the way we load unit test helpers. Instead of requiring each file individually, we now have a single file that requires all of them. This makes it easier to add new helpers and ensures that they are loaded in the correct order.
- Loading branch information
1 parent
423eddb
commit c17c0d7
Showing
2 changed files
with
27 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module UnitTests | ||
class Configuration | ||
CLASSES = %i[ | ||
ActiveModelHelpers | ||
ActiveModelVersions | ||
ActiveRecordVersions | ||
ClassBuilder | ||
ColumnTypeHelpers | ||
ControllerBuilder | ||
DatabaseHelpers | ||
I18nFaker | ||
MailerBuilder | ||
MessageHelpers | ||
ModelBuilder | ||
RailsVersions | ||
ValidationMatcherScenarioHelpers | ||
].freeze | ||
|
||
def self.configure_example_groups(config) | ||
CLASSES.each do |class_name| | ||
constantized_class = "UnitTests::#{class_name}" | ||
Object.const_get(constantized_class).configure_example_group(config) | ||
end | ||
end | ||
end | ||
end |
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