core: color success Ui green

This commit is contained in:
Mitchell Hashimoto 2014-01-23 13:15:07 -08:00
parent 09955be2cd
commit 00530303fb
2 changed files with 12 additions and 0 deletions

View File

@ -277,6 +277,7 @@ module Vagrant
# Special case some colors for certain message types
opts[:color] = :red if type == :error
opts[:color] = :green if type == :success
opts[:color] = :yellow if type == :warn
# If there is no color specified, exit early

View File

@ -130,6 +130,17 @@ describe Vagrant::UI::Colored do
end
end
describe "#success" do
it "colors green" do
subject.should_receive(:safe_puts).with do |message, *args|
expect(message).to start_with("\033[0;32m")
expect(message).to end_with("\033[0m")
end
subject.success("foo")
end
end
describe "#warn" do
it "colors yellow" do
subject.should_receive(:safe_puts).with do |message, *args|