Added SystemInfo and FileSystems to query system and file system information, respectively.

This commit is contained in:
Adam Murdoch
2012-08-12 06:17:58 +10:00
parent 5f3761dd41
commit 3a58e27eeb
18 changed files with 612 additions and 327 deletions

View 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())
}
}

View 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
}
}