core: use default color by default (not white)

This commit is contained in:
Mitchell Hashimoto 2014-03-05 10:19:53 -08:00
parent cf92d9ce00
commit 7f2fe524b3
3 changed files with 7 additions and 2 deletions

View File

@ -188,7 +188,7 @@ module Vagrant
machines.reverse! if options[:reverse] machines.reverse! if options[:reverse]
# Go through each VM and yield it! # Go through each VM and yield it!
color_order = [:white] color_order = [:default]
color_index = 0 color_index = 0
machines.each do |machine| machines.each do |machine|

View File

@ -323,7 +323,7 @@ module Vagrant
# is bolded. # is bolded.
bold = !!opts[:bold] bold = !!opts[:bold]
colorseq = "#{bold ? 1 : 0 }" colorseq = "#{bold ? 1 : 0 }"
if opts[:color] if opts[:color] && opts[:color] != :default
color = COLORS[opts[:color]] color = COLORS[opts[:color]]
colorseq += ";#{color}" colorseq += ";#{color}"
end end

View File

@ -114,6 +114,11 @@ describe Vagrant::UI::Colored do
subject.output("foo") subject.output("foo")
end end
it "doesn't use a color if default color" do
subject.should_receive(:safe_puts).with("\033[0mfoo\033[0m", anything)
subject.output("foo", color: :default)
end
it "bolds output without color if specified" do it "bolds output without color if specified" do
subject.should_receive(:safe_puts).with("\033[1mfoo\033[0m", anything) subject.should_receive(:safe_puts).with("\033[1mfoo\033[0m", anything)
subject.output("foo", bold: true) subject.output("foo", bold: true)