Implemented Terminal.bold(), foreground(), normal() and reset().
This commit is contained in:
@@ -3,6 +3,8 @@ package net.rubygrapefruit.platform
|
||||
import org.junit.Rule
|
||||
import org.junit.rules.TemporaryFolder
|
||||
import spock.lang.Specification
|
||||
import net.rubygrapefruit.platform.internal.Platform
|
||||
import spock.lang.IgnoreIf
|
||||
|
||||
class TerminalTest extends Specification {
|
||||
@Rule TemporaryFolder tmpDir
|
||||
@@ -14,12 +16,23 @@ class TerminalTest extends Specification {
|
||||
!terminal.isTerminal(TerminalAccess.Output.Stderr);
|
||||
}
|
||||
|
||||
def "cannot access terminal from a test"() {
|
||||
@IgnoreIf({Platform.current().windows})
|
||||
def "cannot access posix terminal from a test"() {
|
||||
when:
|
||||
terminal.getTerminal(TerminalAccess.Output.Stdout)
|
||||
|
||||
then:
|
||||
NativeException e = thrown()
|
||||
e.message == 'Could not open terminal: not a terminal'
|
||||
e.message == 'Could not open terminal for stdout: not a terminal'
|
||||
}
|
||||
|
||||
@IgnoreIf({!Platform.current().windows})
|
||||
def "cannot access windows console from a test"() {
|
||||
when:
|
||||
terminal.getTerminal(TerminalAccess.Output.Stdout)
|
||||
|
||||
then:
|
||||
NativeException e = thrown()
|
||||
e.message == 'Could not open console for stdout: not a console'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user