Added SystemInfo and FileSystems to query system and file system information, respectively.
This commit is contained in:
15
src/test/groovy/net/rubygrapefruit/platform/FileSystemsTest.groovy
Executable file
15
src/test/groovy/net/rubygrapefruit/platform/FileSystemsTest.groovy
Executable file
@@ -0,0 +1,15 @@
|
||||
package net.rubygrapefruit.platform
|
||||
|
||||
import org.junit.Rule
|
||||
import org.junit.rules.TemporaryFolder
|
||||
import spock.lang.Specification
|
||||
|
||||
class FileSystemsTest extends Specification {
|
||||
@Rule TemporaryFolder tmpDir
|
||||
final FileSystems fileSystems = Native.get(FileSystems.class)
|
||||
|
||||
def "can query filesystem details"() {
|
||||
expect:
|
||||
fileSystems.fileSystems.collect() { it.mountPoint }.containsAll(File.listRoots())
|
||||
}
|
||||
}
|
||||
17
src/test/groovy/net/rubygrapefruit/platform/SystemInfoTest.groovy
Executable file
17
src/test/groovy/net/rubygrapefruit/platform/SystemInfoTest.groovy
Executable file
@@ -0,0 +1,17 @@
|
||||
package net.rubygrapefruit.platform
|
||||
|
||||
import org.junit.Rule
|
||||
import org.junit.rules.TemporaryFolder
|
||||
import spock.lang.Specification
|
||||
|
||||
class SystemInfoTest extends Specification {
|
||||
@Rule TemporaryFolder tmpDir
|
||||
final SystemInfo systemInfo = Native.get(SystemInfo.class)
|
||||
|
||||
def "can query OS details"() {
|
||||
expect:
|
||||
systemInfo.kernelName
|
||||
systemInfo.kernelVersion
|
||||
systemInfo.machineArchitecture
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user