core: Ui::Prefixed can take prefix_spaces option
This commit is contained in:
parent
2d7c161f49
commit
e6ca9d6f81
|
@ -267,7 +267,7 @@ module Vagrant
|
|||
if !opts.has_key?(:prefix) || opts[:prefix]
|
||||
prefix = OUTPUT_PREFIX
|
||||
prefix = " " * OUTPUT_PREFIX.length if \
|
||||
type == :detail || type == :ask
|
||||
type == :detail || type == :ask || opts[:prefix_spaces]
|
||||
end
|
||||
|
||||
# Fast-path if there is no prefix
|
||||
|
|
|
@ -293,6 +293,11 @@ describe Vagrant::UI::Prefixed do
|
|||
subject.output("foo")
|
||||
end
|
||||
|
||||
it "prefixes with spaces if requested" do
|
||||
ui.should_receive(:output).with(" #{prefix}: foo", anything)
|
||||
subject.output("foo", prefix_spaces: true)
|
||||
end
|
||||
|
||||
it "prefixes every line" do
|
||||
ui.should_receive(:output).with("==> #{prefix}: foo\n==> #{prefix}: bar", anything)
|
||||
subject.output("foo\nbar")
|
||||
|
|
Loading…
Reference in New Issue