core: ui can hide details
This commit is contained in:
parent
d0cd2464b2
commit
a4f64d0148
|
@ -182,6 +182,9 @@ module Vagrant
|
||||||
defaults = { :new_line => true, :prefix => true }
|
defaults = { :new_line => true, :prefix => true }
|
||||||
opts = defaults.merge(@opts).merge(opts)
|
opts = defaults.merge(@opts).merge(opts)
|
||||||
|
|
||||||
|
# Don't output if we're hiding details
|
||||||
|
return if type == :detail && opts[:hide_detail]
|
||||||
|
|
||||||
# Determine whether we're expecting to output our
|
# Determine whether we're expecting to output our
|
||||||
# own new line or not.
|
# own new line or not.
|
||||||
printer = opts[:new_line] ? :puts : :print
|
printer = opts[:new_line] ? :puts : :print
|
||||||
|
|
|
@ -58,6 +58,24 @@ describe Vagrant::UI::Basic do
|
||||||
subject.error("foo")
|
subject.error("foo")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "#detail" do
|
||||||
|
it "outputs details" do
|
||||||
|
subject.should_receive(:safe_puts).with do |message, **opts|
|
||||||
|
expect(message).to eq("foo")
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
subject.detail("foo")
|
||||||
|
end
|
||||||
|
|
||||||
|
it "doesn't output details if disabled" do
|
||||||
|
subject.should_receive(:safe_puts).never
|
||||||
|
|
||||||
|
subject.opts[:hide_detail] = true
|
||||||
|
subject.detail("foo")
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe Vagrant::UI::Colored do
|
describe Vagrant::UI::Colored do
|
||||||
|
|
Loading…
Reference in New Issue