此版本仍在开发中,尚未被视为稳定版本。对于最新的稳定版本,请使用 Spring Shell 3.4.0spring-doc.cadn.net.cn

设置

默认情况下,内置仿真使用终端宽度 80 和高度 24。 如果输出将跨越多行,则更改尺寸非常有用 并且您不想在 A 测试中处理这些情况。spring-doc.cadn.net.cn

可以使用属性更改这些设置spring.shell.test.terminal-widthspring.shell.test.terminal-height.spring-doc.cadn.net.cn

@ShellTest(properties = {
	"spring.shell.test.terminal-width=120",
	"spring.shell.test.terminal-height=40"
})
class ShellSettingsSample {}

ShellTest注释包含字段terminalWidthterminalHeight也可用于更改尺寸。spring-doc.cadn.net.cn

@ShellTest(terminalWidth = 120, terminalHeight = 40)
class ShellSettingsSample {}