test: allow skipping certain tests on Windows

This commit is contained in:
Mitchell Hashimoto 2014-01-15 10:54:50 -08:00
parent 37e9553bf5
commit b386e1dbbd
2 changed files with 7 additions and 1 deletions

View File

@ -5,6 +5,7 @@ require "rspec/autorun"
# Require Vagrant itself so we can reference the proper # Require Vagrant itself so we can reference the proper
# classes to test. # classes to test.
require "vagrant" require "vagrant"
require "vagrant/util/platform"
# Add the test directory to the load path # Add the test directory to the load path
$:.unshift File.expand_path("../../", __FILE__) $:.unshift File.expand_path("../../", __FILE__)
@ -25,6 +26,11 @@ $stderr.sync = true
# Configure RSpec # Configure RSpec
RSpec.configure do |c| RSpec.configure do |c|
c.expect_with :rspec, :stdlib c.expect_with :rspec, :stdlib
c.treat_symbols_as_metadata_keys_with_true_values = true
if Vagrant::Util::Platform.windows?
c.filter_run_excluding :skip_windows
end
end end
# Configure VAGRANT_CWD so that the tests never find an actual # Configure VAGRANT_CWD so that the tests never find an actual

View File

@ -20,7 +20,7 @@ describe Vagrant::Util::SSH do
key_path.stat.mode.should == mode key_path.stat.mode.should == mode
end end
it "should fix the permissions" do it "should fix the permissions", :skip_windows do
key_path.chmod(0644) key_path.chmod(0644)
described_class.check_key_permissions(key_path) described_class.check_key_permissions(key_path)