mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Fix constant redefinition warnings when running specs (#29837)
Don't load rake files over and over again when running specs.
This commit is contained in:
committed by
GitHub
parent
abfd065ff0
commit
6e1aeb1f50
@@ -251,6 +251,13 @@ module Helpers
|
||||
theme
|
||||
end
|
||||
|
||||
# Invokes a Rake task in a way that is safe for the test environment
|
||||
def invoke_rake_task(task_name, *args)
|
||||
Rake::Task[task_name].invoke(*args)
|
||||
ensure
|
||||
Rake::Task[task_name].reenable
|
||||
end
|
||||
|
||||
# Uploads a theme component from a directory.
|
||||
#
|
||||
# @param parent_theme_id [Integer] The ID of the theme to add the theme component to. Defaults to `SiteSetting.default_theme_id`.
|
||||
|
||||
Reference in New Issue
Block a user