summaryrefslogtreecommitdiff
path: root/test/ruby/test_exception.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-09-02 16:46:28 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-09-02 16:46:28 +0900
commit8e38d4c78c1a9b45f604963f85995e9a817ee72c (patch)
treebd863b69540229d44402c699c0d5d7eef4aec0c2 /test/ruby/test_exception.rb
parent6f206b8ec6f945804c56cf8249739c6e94ed65f6 (diff)
Rewrote using assert_separately
Diffstat (limited to 'test/ruby/test_exception.rb')
-rw-r--r--test/ruby/test_exception.rb24
1 files changed, 8 insertions, 16 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb
index 713a59df70..55f0d27c88 100644
--- a/test/ruby/test_exception.rb
+++ b/test/ruby/test_exception.rb
@@ -488,20 +488,15 @@ end.join
end
def test_exception_in_name_error_to_str
+ assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
bug5575 = '[ruby-core:41612]'
- Tempfile.create(["test_exception_in_name_error_to_str", ".rb"]) do |t|
- t.puts <<-EOC
+ begin;
begin
BasicObject.new.inspect
rescue
- $!.inspect
- end
- EOC
- t.close
- assert_nothing_raised(NameError, bug5575) do
- load(t.path)
+ assert_nothing_raised(NameError, bug5575) {$!.inspect}
end
- end
+ end;
end
def test_equal
@@ -511,19 +506,16 @@ end.join
end
def test_exception_in_exception_equal
+ assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
bug5865 = '[ruby-core:41979]'
- Tempfile.create(["test_exception_in_exception_equal", ".rb"]) do |t|
- t.puts <<-EOC
+ begin;
o = Object.new
def o.exception(arg)
end
- _ = RuntimeError.new("a") == o
- EOC
- t.close
assert_nothing_raised(ArgumentError, bug5865) do
- load(t.path)
+ RuntimeError.new("a") == o
end
- end
+ end;
end
Bug4438 = '[ruby-core:35364]'