Skip to content

Commit 5c44437

Browse files
committed
Add an extra test for disabled power mode when the power config key is unset
1 parent 55107f1 commit 5c44437

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

modules/integration/src/test/scala/scala/cli/integration/SipScalaTests.scala

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,21 @@ class SipScalaTests extends ScalaCliSuite {
144144
TestInputs.empty.fromRoot { root =>
145145
val homeEnv = Map("SCALA_CLI_CONFIG" -> (root / "config" / "config.json").toString())
146146
// disable power features
147-
os.proc(TestUtil.cli, "config", "power", "false").call(cwd = root, env = homeEnv).out.trim()
148-
val output = os.proc(TestUtil.cli, subCommand).call(
149-
cwd = root,
150-
check = false,
151-
mergeErrIntoOut = true,
152-
env = homeEnv
153-
).out.text().trim
154-
expect(output.contains(
155-
s"""This command is $restrictionType and requires setting the '--power' launcher option to be used"""
156-
))
147+
for (disablePowerSetting <- Seq("false", "--unset")) {
148+
os.proc(TestUtil.cli, "config", "power", disablePowerSetting).call(
149+
cwd = root,
150+
env = homeEnv
151+
).out.trim()
152+
val output = os.proc(TestUtil.cli, subCommand).call(
153+
cwd = root,
154+
check = false,
155+
mergeErrIntoOut = true,
156+
env = homeEnv
157+
).out.text().trim
158+
expect(output.contains(
159+
s"""This command is $restrictionType and requires setting the '--power' launcher option to be used"""
160+
))
161+
}
157162
// enable power features
158163
os.proc(TestUtil.cli, "config", "power", "true").call(cwd = root, env = homeEnv).out.trim()
159164
val powerOutput = os.proc(TestUtil.cli, subCommand).call(

0 commit comments

Comments
 (0)