vaguerent/test/unit/support/shared/base_context.rb
Mitchell Hashimoto 1a8c4199b2 Introduce Config::Loader
Config::Loader will be the new class responsible for loading configuration
and replaces the previous dual-role "Vagrant::Config" played. While this
commit is very early-stage, once this new architecture is flushed out, it
will make loading, using, and extending configuration much easier and cleaner.

Additionally, I believe this will help post Vagrant 1.0 if multi-language
configuration is implemented.
2011-12-03 17:12:48 -08:00

17 lines
313 B
Ruby

require "tempfile"
shared_context "unit" do
# This helper creates a temporary file and returns a Pathname
# object pointed to it.
def temporary_file(contents=nil)
f = Tempfile.new("vagrant-unit")
if contents
f.write(contents)
f.flush
end
return Pathname.new(f.path)
end
end