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:
parent
62cdd6e64a
commit
9faa910961
1 changed files with 10 additions and 6 deletions
|
@ -367,7 +367,9 @@ 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 = nil
|
||||
Tempfile.open(["test_exception_in_name_error_to_str", ".rb"]) do |f|
|
||||
t = f
|
||||
t.puts <<-EOC
|
||||
begin
|
||||
BasicObject.new.inspect
|
||||
|
@ -375,7 +377,7 @@ end.join
|
|||
$!.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 = 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
|
||||
|
|
Loading…
Reference in a new issue