mirror of
https://github.com/discourse/discourse.git
synced 2025-06-14 04:22:54 +08:00
DEV: Tests can reset a single registry (#13618)
Plugins can use this method to reset their specific registries without touching the ones defined in core.
This commit is contained in:
@ -227,4 +227,11 @@ class DiscoursePluginRegistry
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.reset_register!(register_name)
|
||||||
|
found_register = @@register_names.detect { |name| name == register_name }
|
||||||
|
|
||||||
|
if found_register
|
||||||
|
instance_variable_set(:"@#{found_register}", nil)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user