diff --git a/lib/vagrant/util.rb b/lib/vagrant/util.rb new file mode 100644 index 000000000..16ee61efd --- /dev/null +++ b/lib/vagrant/util.rb @@ -0,0 +1,7 @@ +module Vagrant + module Util + def self.included(base) + base.extend(self) + end + end +end diff --git a/test/vagrant/util_test.rb b/test/vagrant/util_test.rb new file mode 100644 index 000000000..f9ebe1ece --- /dev/null +++ b/test/vagrant/util_test.rb @@ -0,0 +1,27 @@ +require File.join(File.dirname(__FILE__), '..', 'test_helper') + +class UtilTest < Test::Unit::TestCase + class UtilIncludeTest + include Vagrant::Util + end + + setup do + @klass = UtilIncludeTest + end + + context "with a class" do + should "have the util methods" do + assert @klass.respond_to?(:error_and_exit) + end + end + + context "with an instance" do + setup do + @instance = @klass.new + end + + should "have the util methods" do + assert @instance.respond_to?(:error_and_exit) + end + end +end