设置
内置仿真默认使用终端宽度 80 和高度 24。更改尺寸在输出跨越多行时很有用,如果你不想在测试中处理这些情况。
这些可以通过属性 spring.shell.test.terminal-width
或 spring.shell.test.terminal-height
来更改。
@ShellTest(properties = {
"spring.shell.test.terminal-width=120",
"spring.shell.test.terminal-height=40"
})
class ShellSettingsSample {}
ShellTest
注解具有 terminalWidth
和 terminalHeight
字段,这些字段也可以用来更改尺寸。
@ShellTest(terminalWidth = 120, terminalHeight = 40)
class ShellSettingsSample {}