2014-01-15 18:48:19 +00:00
|
|
|
require "tmpdir"
|
2011-12-04 00:07:34 +00:00
|
|
|
require "rubygems"
|
2014-09-01 22:06:51 +00:00
|
|
|
|
|
|
|
# Gems
|
|
|
|
require "checkpoint"
|
2011-12-04 00:07:34 +00:00
|
|
|
require "rspec/autorun"
|
2014-12-09 01:42:00 +00:00
|
|
|
require "webmock/rspec"
|
2011-12-04 00:07:34 +00:00
|
|
|
|
|
|
|
# Require Vagrant itself so we can reference the proper
|
|
|
|
# classes to test.
|
|
|
|
require "vagrant"
|
2014-01-15 18:54:50 +00:00
|
|
|
require "vagrant/util/platform"
|
2011-12-04 00:07:34 +00:00
|
|
|
|
2011-12-11 23:53:11 +00:00
|
|
|
# Add the test directory to the load path
|
2011-12-04 03:05:50 +00:00
|
|
|
$:.unshift File.expand_path("../../", __FILE__)
|
2011-12-04 01:12:48 +00:00
|
|
|
|
|
|
|
# Load in helpers
|
2013-11-23 23:48:00 +00:00
|
|
|
require "unit/support/dummy_communicator"
|
2012-12-23 04:03:39 +00:00
|
|
|
require "unit/support/dummy_provider"
|
2011-12-11 23:53:11 +00:00
|
|
|
require "unit/support/shared/base_context"
|
2013-12-04 02:30:59 +00:00
|
|
|
require "unit/support/shared/action_synced_folders_context"
|
2014-01-08 00:26:58 +00:00
|
|
|
require "unit/support/shared/capability_helpers_context"
|
2014-01-11 17:32:13 +00:00
|
|
|
require "unit/support/shared/plugin_command_context"
|
2013-11-22 18:26:36 +00:00
|
|
|
require "unit/support/shared/virtualbox_context"
|
2011-12-04 01:12:48 +00:00
|
|
|
|
2011-12-04 00:07:34 +00:00
|
|
|
# Do not buffer output
|
|
|
|
$stdout.sync = true
|
|
|
|
$stderr.sync = true
|
|
|
|
|
|
|
|
# Configure RSpec
|
|
|
|
RSpec.configure do |c|
|
2014-01-15 18:54:50 +00:00
|
|
|
c.treat_symbols_as_metadata_keys_with_true_values = true
|
|
|
|
|
|
|
|
if Vagrant::Util::Platform.windows?
|
|
|
|
c.filter_run_excluding :skip_windows
|
2014-01-15 19:32:53 +00:00
|
|
|
else
|
|
|
|
c.filter_run_excluding :windows
|
2014-01-15 18:54:50 +00:00
|
|
|
end
|
2011-12-04 00:07:34 +00:00
|
|
|
end
|
2012-06-24 06:56:39 +00:00
|
|
|
|
|
|
|
# Configure VAGRANT_CWD so that the tests never find an actual
|
|
|
|
# Vagrantfile anywhere, or at least this minimizes those chances.
|
2014-01-15 18:48:19 +00:00
|
|
|
ENV["VAGRANT_CWD"] = Dir.mktmpdir("vagrant")
|
2014-01-08 03:26:03 +00:00
|
|
|
|
2014-01-13 19:25:29 +00:00
|
|
|
# Set the dummy provider to the default for tests
|
|
|
|
ENV["VAGRANT_DEFAULT_PROVIDER"] = "dummy"
|
|
|
|
|
2014-01-08 03:26:03 +00:00
|
|
|
# Unset all host plugins so that we aren't executing subprocess things
|
|
|
|
# to detect a host for every test.
|
|
|
|
Vagrant.plugin("2").manager.registered.dup.each do |plugin|
|
|
|
|
if plugin.components.hosts.to_hash.length > 0
|
|
|
|
Vagrant.plugin("2").manager.unregister(plugin)
|
|
|
|
end
|
|
|
|
end
|
2014-09-01 22:06:51 +00:00
|
|
|
|
|
|
|
# Disable checkpoint
|
|
|
|
Checkpoint.disable!
|