mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parent
ab1f3d63b0
commit
84b873e381
1 changed files with 10 additions and 8 deletions
|
@ -20,9 +20,9 @@ module TestIRB
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_rc_file
|
def test_rc_file
|
||||||
ENV.delete("IRBRC") # This is for RVM...
|
backup_irbrc = ENV.delete("IRBRC") # This is for RVM...
|
||||||
|
backup_home = ENV["HOME"]
|
||||||
Dir.mktmpdir("test_irb_init_#{$$}") do |tmpdir|
|
Dir.mktmpdir("test_irb_init_#{$$}") do |tmpdir|
|
||||||
backup_home = ENV["HOME"]
|
|
||||||
ENV["HOME"] = tmpdir
|
ENV["HOME"] = tmpdir
|
||||||
|
|
||||||
IRB.conf[:RC_NAME_GENERATOR] = nil
|
IRB.conf[:RC_NAME_GENERATOR] = nil
|
||||||
|
@ -32,15 +32,16 @@ module TestIRB
|
||||||
FileUtils.touch(tmpdir+"/.irb#{IRB::IRBRC_EXT}")
|
FileUtils.touch(tmpdir+"/.irb#{IRB::IRBRC_EXT}")
|
||||||
assert_equal(tmpdir+"/.irb#{IRB::IRBRC_EXT}", IRB.rc_file)
|
assert_equal(tmpdir+"/.irb#{IRB::IRBRC_EXT}", IRB.rc_file)
|
||||||
assert_equal(tmpdir+"/.irb_history", IRB.rc_file("_history"))
|
assert_equal(tmpdir+"/.irb_history", IRB.rc_file("_history"))
|
||||||
|
|
||||||
ENV["HOME"] = backup_home
|
|
||||||
end
|
end
|
||||||
|
ensure
|
||||||
|
ENV["HOME"] = backup_home
|
||||||
|
ENV["IRBRC"] = backup_irbrc
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_rc_file_in_subdir
|
def test_rc_file_in_subdir
|
||||||
ENV.delete("IRBRC") # This is for RVM...
|
backup_irbrc = ENV.delete("IRBRC") # This is for RVM...
|
||||||
|
backup_home = ENV["HOME"]
|
||||||
Dir.mktmpdir("test_irb_init_#{$$}") do |tmpdir|
|
Dir.mktmpdir("test_irb_init_#{$$}") do |tmpdir|
|
||||||
backup_home = ENV["HOME"]
|
|
||||||
ENV["HOME"] = tmpdir
|
ENV["HOME"] = tmpdir
|
||||||
|
|
||||||
FileUtils.mkdir_p("#{tmpdir}/mydir")
|
FileUtils.mkdir_p("#{tmpdir}/mydir")
|
||||||
|
@ -53,9 +54,10 @@ module TestIRB
|
||||||
assert_equal(tmpdir+"/.irb#{IRB::IRBRC_EXT}", IRB.rc_file)
|
assert_equal(tmpdir+"/.irb#{IRB::IRBRC_EXT}", IRB.rc_file)
|
||||||
assert_equal(tmpdir+"/.irb_history", IRB.rc_file("_history"))
|
assert_equal(tmpdir+"/.irb_history", IRB.rc_file("_history"))
|
||||||
end
|
end
|
||||||
|
|
||||||
ENV["HOME"] = backup_home
|
|
||||||
end
|
end
|
||||||
|
ensure
|
||||||
|
ENV["HOME"] = backup_home
|
||||||
|
ENV["IRBRC"] = backup_irbrc
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue