test/ruby: independent from pathname
* test/ruby/test_dir.rb (TestDir#setup): remove dependency on pathname. * test/ruby/test_rubyoptions.rb (TestRubyOptions#with_tmpchdir): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
87e185da06
commit
8cbd501ed0
@ -2,14 +2,13 @@ require 'test/unit'
|
|||||||
|
|
||||||
require 'tmpdir'
|
require 'tmpdir'
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
require 'pathname'
|
|
||||||
|
|
||||||
class TestDir < Test::Unit::TestCase
|
class TestDir < Test::Unit::TestCase
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@verbose = $VERBOSE
|
@verbose = $VERBOSE
|
||||||
$VERBOSE = nil
|
$VERBOSE = nil
|
||||||
@root = Pathname.new(Dir.mktmpdir('__test_dir__')).realpath.to_s
|
@root = File.realpath(Dir.mktmpdir('__test_dir__'))
|
||||||
@nodir = File.join(@root, "dummy")
|
@nodir = File.join(@root, "dummy")
|
||||||
for i in ?a..?z
|
for i in ?a..?z
|
||||||
if i.ord % 2 == 0
|
if i.ord % 2 == 0
|
||||||
|
@ -3,7 +3,6 @@ require 'test/unit'
|
|||||||
|
|
||||||
require 'tmpdir'
|
require 'tmpdir'
|
||||||
require 'tempfile'
|
require 'tempfile'
|
||||||
require 'pathname'
|
|
||||||
|
|
||||||
require_relative 'envutil'
|
require_relative 'envutil'
|
||||||
|
|
||||||
@ -16,7 +15,7 @@ class TestRubyOptions < Test::Unit::TestCase
|
|||||||
|
|
||||||
def with_tmpchdir
|
def with_tmpchdir
|
||||||
Dir.mktmpdir {|d|
|
Dir.mktmpdir {|d|
|
||||||
d = Pathname.new(d).realpath.to_s
|
d = File.realpath(d)
|
||||||
Dir.chdir(d) {
|
Dir.chdir(d) {
|
||||||
yield d
|
yield d
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user