Moved error_and_exit and wrap_output to their own mixins

This commit is contained in:
Mitchell Hashimoto 2010-05-20 16:09:00 -07:00
parent a1794dca80
commit 398e254c39
4 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,15 @@
module Vagrant
module Util
module ErrorHelper
def error_and_exit(key, data = {})
abort <<-error
=====================================================================
Vagrant experienced an error!
#{Translator.t(key, data).chomp}
=====================================================================
error
end
end
end
end

View File

@ -0,0 +1,11 @@
module Vagrant
module Util
module OutputHelper
def wrap_output
puts "====================================================================="
yield
puts "====================================================================="
end
end
end
end

View File

@ -0,0 +1,5 @@
require File.join(File.dirname(__FILE__), '..', '..', 'test_helper')
class ErrorHelperUtilTest < Test::Unit::TestCase
# TODO
end

View File

@ -0,0 +1,5 @@
require File.join(File.dirname(__FILE__), '..', '..', 'test_helper')
class OutputHelperUtilTest < Test::Unit::TestCase
# TODO
end