mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[test framework] utility method for temporary setting a registry value
GitOrigin-RevId: dcfd782b7546cd4ff1948f20fe3b89f76c802a0f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ac3046b828
commit
b846a86e9e
@@ -0,0 +1,14 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
@file:JvmName("RegistryTestUtil")
|
||||
package com.intellij.openapi.util.registry
|
||||
|
||||
fun RegistryValue.withValue(tempValue: Boolean, block: () -> Unit) {
|
||||
val currentValue = asBoolean()
|
||||
try {
|
||||
setValue(tempValue)
|
||||
block()
|
||||
}
|
||||
finally {
|
||||
setValue(currentValue)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user