Permalink
Browse files

Skip read access test on Windows

Permissions defined by chmod are no-op in Windows, as NT filesystem
do not support POSIX-like permissions.
  • Loading branch information...
1 parent 32984ae commit 757d8d30d979832b1109a418ea25794dfc0ed241 @luislavena luislavena committed Feb 24, 2013
Showing with 8 additions and 0 deletions.
  1. +8 −0 test/test_filename_completion_proc.rb
@@ -1,6 +1,7 @@
require 'test/unit'
require 'fileutils'
require 'readline'
+require "rbconfig"
require "#{File.expand_path(File.dirname(__FILE__))}/filesystem_completion_helper"
class TestFilenameCompletionProc < Test::Unit::TestCase
@@ -70,10 +71,17 @@ def test_list_files_in_current_directory
def test_listing_files_with_no_read_access
FileUtils.mkdir("test_no_access")
FileUtils.touch("test_no_access/123")
+
+ skip "chmod is noop in Windows" if windows?
+
FileUtils.chmod(0333, "test_no_access")
assert_nil Readline::FILENAME_COMPLETION_PROC.call("test_no_access/")
ensure
FileUtils.chmod(0775, "test_no_access")
FileUtils.rm_r("test_no_access")
end
+
+ def windows?
+ RbConfig::CONFIG["host_os"] =~ /mingw|mswin/
+ end
end

0 comments on commit 757d8d3

Please sign in to comment.