diff options
-rw-r--r-- | test/ruby/test_file_exhaustive.rb | 14 | ||||
-rw-r--r-- | test/ruby/test_require.rb | 10 |
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 |