Get the tests passing

This commit is contained in:
Mitchell Hashimoto 2011-11-27 16:50:26 -07:00
parent 6ea3335de6
commit 282bf37350
3 changed files with 4 additions and 30 deletions

View File

@ -243,7 +243,7 @@ module Vagrant
result.env = self
result
else
UI.new(self)
UI::Silent.new(self)
end
end

View File

@ -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

View File

@ -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