1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
usa 2010-05-04 16:02:17 +00:00
parent 576252ae9d
commit fd328d8ea1
2 changed files with 17 additions and 7 deletions

View file

@ -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)

View file

@ -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