2020-10-09 08:20:50 +00:00
|
|
|
package biz.nellemann.hmci
|
|
|
|
|
|
|
|
import spock.lang.Specification
|
|
|
|
|
2021-03-24 12:25:34 +00:00
|
|
|
import java.nio.file.Path
|
|
|
|
import java.nio.file.Paths
|
|
|
|
|
2020-10-09 08:20:50 +00:00
|
|
|
|
|
|
|
class ConfigurationTest extends Specification {
|
|
|
|
|
2021-03-24 12:25:34 +00:00
|
|
|
Path testConfigurationFile = Paths.get(getClass().getResource('/hmci.toml').toURI())
|
2020-10-09 08:20:50 +00:00
|
|
|
|
2022-02-08 20:39:42 +00:00
|
|
|
void "test parsing of configuration file"() {
|
2020-10-09 08:20:50 +00:00
|
|
|
|
|
|
|
when:
|
2020-10-12 08:15:53 +00:00
|
|
|
Configuration conf = new Configuration(testConfigurationFile)
|
2020-10-09 08:20:50 +00:00
|
|
|
|
|
|
|
then:
|
|
|
|
conf != null
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2022-02-08 20:39:42 +00:00
|
|
|
void "test energy flag, default setting"() {
|
2020-10-09 08:20:50 +00:00
|
|
|
|
|
|
|
when:
|
2020-10-12 08:15:53 +00:00
|
|
|
Configuration conf = new Configuration(testConfigurationFile)
|
2020-10-09 08:20:50 +00:00
|
|
|
|
|
|
|
then:
|
2022-02-08 20:39:42 +00:00
|
|
|
!conf.getHmc().get(0).energy
|
2020-10-09 08:20:50 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|