Get the tests passing
This commit is contained in:
parent
6ea3335de6
commit
282bf37350
|
@ -243,7 +243,7 @@ module Vagrant
|
|||
result.env = self
|
||||
result
|
||||
else
|
||||
UI.new(self)
|
||||
UI::Silent.new(self)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue