зеркало из https://github.com/github/ruby.git
[ruby/fileutils] Fix test_cp_r_dev on Windows or other systems without character/block device in /dev
Previously this would give an error such as: TestFileUtils#test_cp_r_dev [c:/fileutils/test/fileutils/test_fileutils.rb:455]: [RuntimeError] exception expected, not. Class: <TypeError> Message: <"no implicit conversion of nil into String"> https://github.com/ruby/fileutils/commit/0ce0fefbeb
This commit is contained in:
Родитель
9494ef8b2d
Коммит
9792c9d183
|
@ -450,11 +450,11 @@ class TestFileUtils < Test::Unit::TestCase
|
|||
|
||||
def test_cp_r_dev
|
||||
devs = Dir['/dev/*']
|
||||
chardev = Dir['/dev/*'].find{|f| File.chardev?(f)}
|
||||
blockdev = Dir['/dev/*'].find{|f| File.blockdev?(f)}
|
||||
chardev = devs.find{|f| File.chardev?(f)}
|
||||
blockdev = devs.find{|f| File.blockdev?(f)}
|
||||
Dir.mkdir('tmp/cpr_dest')
|
||||
assert_raise(RuntimeError) { cp_r chardev, 'tmp/cpr_dest/cd' }
|
||||
assert_raise(RuntimeError) { cp_r blockdev, 'tmp/cpr_dest/bd' }
|
||||
assert_raise(RuntimeError) { cp_r chardev, 'tmp/cpr_dest/cd' } if chardev
|
||||
assert_raise(RuntimeError) { cp_r blockdev, 'tmp/cpr_dest/bd' } if blockdev
|
||||
end
|
||||
|
||||
begin
|
||||
|
|
Загрузка…
Ссылка в новой задаче