-
Notifications
You must be signed in to change notification settings - Fork 0
/
DisablingValidations.groovy
29 lines (26 loc) · 1.11 KB
/
DisablingValidations.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package me.biocomp.hubitat_ci_example
import me.biocomp.hubitat_ci.api.app_api.AppExecutor
import me.biocomp.hubitat_ci.api.device_api.DeviceExecutor
import me.biocomp.hubitat_ci.app.HubitatAppSandbox
import me.biocomp.hubitat_ci.device.HubitatDeviceSandbox
import me.biocomp.hubitat_ci.util.CapturingLog
import me.biocomp.hubitat_ci.validation.Flags
import spock.lang.Specification
class DisablingValidations extends Specification
{
def "You can disable most built-in validations"()
{
expect:
new HubitatAppSandbox(new File("bad_app_script.groovy"))
.run(validationFlags:
[Flags.AllowNullEnumInputOptions, // Enum should have 'options', but doesn't in this case
Flags.AllowNullListOptions, // Same reason - for enum
Flags.DontValidateDefinition]) // definition() is completely omitted in this script
}
def "Don't run init at all"()
{
expect:
new HubitatAppSandbox(new File("bad_app_script.groovy"))
.run(validationFlags: [Flags.DontRunScript])
}
}