鲁比/厨师/菜鸟在这里。
我们正在使用techchef来测试用户在Linux中的存在性。
当运行类似于
describe user(username) do
it "should exist" do
# The existence check itself is included in the custom description.
expect(subject.exists?).to eq(true)
end
end
它会打印以下消息。
User user1 is expected to exist
有没有什么方法可以隐藏或自定义消息?
谢谢
1条答案
按热度按时间mzmfm0qo1#
Inspec支持reporters自定义输出。我并不完全清楚您希望从输出中更改什么,但如果您想要更简洁的东西,
progress
或progress-bar
报告器似乎是您可能需要的。看起来它会给你给予经典的点的级数。
如果要自定义该行的输出,请在https://github.com/inspec/inspec/blob/main/lib/inspec/resources/users.rb#L314的XML中定义User类
它只有一个简单的
to_s
方法。您可以在设置中覆盖该方法。比如说,