mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Rewrote using assert_separately
This commit is contained in:
parent
6f206b8ec6
commit
8e38d4c78c
1 changed files with 8 additions and 16 deletions
|
@ -488,20 +488,15 @@ end.join
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_exception_in_name_error_to_str
|
def test_exception_in_name_error_to_str
|
||||||
|
assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
|
||||||
bug5575 = '[ruby-core:41612]'
|
bug5575 = '[ruby-core:41612]'
|
||||||
Tempfile.create(["test_exception_in_name_error_to_str", ".rb"]) do |t|
|
begin;
|
||||||
t.puts <<-EOC
|
|
||||||
begin
|
begin
|
||||||
BasicObject.new.inspect
|
BasicObject.new.inspect
|
||||||
rescue
|
rescue
|
||||||
$!.inspect
|
assert_nothing_raised(NameError, bug5575) {$!.inspect}
|
||||||
end
|
|
||||||
EOC
|
|
||||||
t.close
|
|
||||||
assert_nothing_raised(NameError, bug5575) do
|
|
||||||
load(t.path)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
end;
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_equal
|
def test_equal
|
||||||
|
@ -511,19 +506,16 @@ end.join
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_exception_in_exception_equal
|
def test_exception_in_exception_equal
|
||||||
|
assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
|
||||||
bug5865 = '[ruby-core:41979]'
|
bug5865 = '[ruby-core:41979]'
|
||||||
Tempfile.create(["test_exception_in_exception_equal", ".rb"]) do |t|
|
begin;
|
||||||
t.puts <<-EOC
|
|
||||||
o = Object.new
|
o = Object.new
|
||||||
def o.exception(arg)
|
def o.exception(arg)
|
||||||
end
|
end
|
||||||
_ = RuntimeError.new("a") == o
|
|
||||||
EOC
|
|
||||||
t.close
|
|
||||||
assert_nothing_raised(ArgumentError, bug5865) do
|
assert_nothing_raised(ArgumentError, bug5865) do
|
||||||
load(t.path)
|
RuntimeError.new("a") == o
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
end;
|
||||||
end
|
end
|
||||||
|
|
||||||
Bug4438 = '[ruby-core:35364]'
|
Bug4438 = '[ruby-core:35364]'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue