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

Tempfile#open

* test/ruby/test_exception.rb (test_systemexit_new,
  test_exception_in_exception_equal): use Tempfile#open.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-03-16 08:38:18 +00:00
parent 62cdd6e64a
commit 9faa910961

View file

@ -367,15 +367,17 @@ end.join
def test_exception_in_name_error_to_str
bug5575 = '[ruby-core:41612]'
t = Tempfile.new(["test_exception_in_name_error_to_str", ".rb"])
t.puts <<-EOC
t = nil
Tempfile.open(["test_exception_in_name_error_to_str", ".rb"]) do |f|
t = f
t.puts <<-EOC
begin
BasicObject.new.inspect
rescue
$!.inspect
end
EOC
t.close
end
assert_nothing_raised(NameError, bug5575) do
load(t.path)
end
@ -391,14 +393,16 @@ end.join
def test_exception_in_exception_equal
bug5865 = '[ruby-core:41979]'
t = Tempfile.new(["test_exception_in_exception_equal", ".rb"])
t.puts <<-EOC
t = nil
Tempfile.open(["test_exception_in_exception_equal", ".rb"]) do |f|
t = f
t.puts <<-EOC
o = Object.new
def o.exception(arg)
end
RuntimeError.new("a") == o
EOC
t.close
end
assert_nothing_raised(ArgumentError, bug5865) do
load(t.path)
end