summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-04 16:02:17 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-04 16:02:17 +0000
commitfd328d8ea15d653130d89a9c59f977b1f4e6d6f6 (patch)
treec6a20f32ad31cc3488b11eedddcf8d82c02dbd50 /test
parent576252ae9d2b5e9601897eeca3aa2f25353068fc (diff)
* test/ruby/test_require.rb (test_relative_symlink): skip if symlink is not
implemented. * test/ruby/test_file_exhaustive.rb (test_stat, test_expand_path): ignore tests about nlink on Windows because its not imeplented because of performance problem. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_file_exhaustive.rb14
-rw-r--r--test/ruby/test_require.rb10
2 files changed, 17 insertions, 7 deletions
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb
index 7d2f4ca9b9..9589e909da 100644
--- a/test/ruby/test_file_exhaustive.rb
+++ b/test/ruby/test_file_exhaustive.rb
@@ -83,7 +83,9 @@ class TestFileExhaustive < Test::Unit::TestCase
assert_integer_or_nil(fs1.rdev_minor)
assert_integer(fs1.ino)
assert_integer(fs1.mode)
- unless /emx/ =~ RUBY_PLATFORM
+ unless /emx|mswin|mingw/ =~ RUBY_PLATFORM
+ # on Windows, nlink is always 1. but this behavior will be changed
+ # in the future.
assert_equal(@hardlinkfile ? 2 : 1, fs1.nlink)
end
assert_integer(fs1.uid)
@@ -393,8 +395,10 @@ class TestFileExhaustive < Test::Unit::TestCase
assert_equal(@file, File.expand_path(@file + "::$DATA"))
end
assert_kind_of(String, File.expand_path("~"))
- assert_raise(ArgumentError) { File.expand_path("~foo_bar_baz_unknown_user_wahaha") }
- assert_raise(ArgumentError) { File.expand_path("~foo_bar_baz_unknown_user_wahaha", "/") }
+ unless /mingw|mswin/ =~ RUBY_PLATFORM
+ assert_raise(ArgumentError) { File.expand_path("~foo_bar_baz_unknown_user_wahaha") }
+ assert_raise(ArgumentError) { File.expand_path("~foo_bar_baz_unknown_user_wahaha", "/") }
+ end
assert_incompatible_encoding {|d| File.expand_path(d)}
end
@@ -574,7 +578,9 @@ class TestFileExhaustive < Test::Unit::TestCase
assert_integer_or_nil(fs1.rdev_minor)
assert_integer(fs1.ino)
assert_integer(fs1.mode)
- unless /emx/ =~ RUBY_PLATFORM
+ unless /emx|mswin|mingw/ =~ RUBY_PLATFORM
+ # on Windows, nlink is always 1. but this behavior will be changed
+ # in the future.
assert_equal(@hardlinkfile ? 2 : 1, fs1.nlink)
end
assert_integer(fs1.uid)
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb
index fbe71a2db5..40eb67da26 100644
--- a/test/ruby/test_require.rb
+++ b/test/ruby/test_require.rb
@@ -290,9 +290,13 @@ class TestRequire < Test::Unit::TestCase
File.open("a/lib.rb", "w") {|f| f.puts 'puts "a/lib.rb"' }
File.open("b/lib.rb", "w") {|f| f.puts 'puts "b/lib.rb"' }
File.open("a/tst.rb", "w") {|f| f.puts 'require_relative "lib"' }
- File.symlink("../a/tst.rb", "b/tst.rb")
- result = IO.popen([EnvUtil.rubybin, "b/tst.rb"]).read
- assert_equal("a/lib.rb\n", result, "[ruby-dev:40040]")
+ begin
+ File.symlink("../a/tst.rb", "b/tst.rb")
+ result = IO.popen([EnvUtil.rubybin, "b/tst.rb"]).read
+ assert_equal("a/lib.rb\n", result, "[ruby-dev:40040]")
+ rescue NotImplementedError
+ skip "File.symlink is not implemented"
+ end
}
}
end