fix test for windows

* _mkdir() has only one argument
* use mktemp && mkdir instead of mkdtemp
* use _getcwd instead of P_tmpdir (sandbox is on current dir)
* test for Dir#tell and Dir#seek: skip when NotImplementedError
This commit is contained in:
takahashim
2015-12-03 00:45:51 +09:00
parent d98ecabd90
commit 71f21845ca
2 changed files with 31 additions and 8 deletions
+16 -8
View File
@@ -108,19 +108,27 @@ end
assert('Dir#tell') do
n = nil
Dir.open(DirTest.sandbox) { |d|
n = d.tell
}
assert_true n.is_a? Integer
begin
Dir.open(DirTest.sandbox) { |d|
n = d.tell
}
assert_true n.is_a? Integer
rescue NotImplementedError => e
skip e.message
end
end
assert('Dir#seek') do
d1 = Dir.open(DirTest.sandbox)
d1.read
n = d1.tell
d1.read
d2 = d1.seek(n)
assert_equal d1, d2
begin
n = d1.tell
d1.read
d2 = d1.seek(n)
assert_equal d1, d2
rescue NotImplementedError => e
skip e.message
end
end
assert('DirTest.teardown') do