diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index 771bf2da5..4d937ae12 100644 --- a/lib/vagrant/environment.rb +++ b/lib/vagrant/environment.rb @@ -243,7 +243,7 @@ module Vagrant result.env = self result else - UI.new(self) + UI::Silent.new(self) end end diff --git a/lib/vagrant/ui.rb b/lib/vagrant/ui.rb index df4210990..e87f1ed50 100644 --- a/lib/vagrant/ui.rb +++ b/lib/vagrant/ui.rb @@ -27,6 +27,9 @@ module Vagrant end end + # This is a UI implementation that does nothing. + class Silent < Interface; end + # This is a UI implementation that outputs the text as is. It # doesn't add any color. class Basic < Interface diff --git a/test/unit/vagrant/ui_test.rb b/test/unit/vagrant/ui_test.rb deleted file mode 100644 index 2f35abb32..000000000 --- a/test/unit/vagrant/ui_test.rb +++ /dev/null @@ -1,29 +0,0 @@ -require "test_helper" - -class ShellUITest < Test::Unit::TestCase - setup do - @klass = Vagrant::UI::Shell - @shell = mock("shell") - @instance = @klass.new(vagrant_env, @shell) - end - - context "prefixing with resource" do - should "prefix message with environment resource" do - @shell.expects(:say).with() do |message, color| - assert message =~ /\[#{@instance.env.resource}\]/ - true - end - - @instance.info("vagrant.errors.test_key") - end - - should "not prefix the message if given false" do - @shell.expects(:say).with() do |message, color| - assert message !~ /\[#{@instance.env.resource}\]/ - true - end - - @instance.info("vagrant.errors.test_key", :prefix => false) - end - end -end