From ae235db25d6d6437862d4823d053d42702d1a07a Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 25 Apr 2020 00:19:01 +0900 Subject: [PATCH] [ruby/rdoc] Should teardown in reverse order of setup https://github.com/ruby/rdoc/commit/00fb4dd2a3 --- test/rdoc/test_rdoc_parser_changelog.rb | 2 ++ test/rdoc/test_rdoc_ri_driver.rb | 4 ++-- test/rdoc/test_rdoc_ri_paths.rb | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/rdoc/test_rdoc_parser_changelog.rb b/test/rdoc/test_rdoc_parser_changelog.rb index cb6406259c..d93cb7deca 100644 --- a/test/rdoc/test_rdoc_parser_changelog.rb +++ b/test/rdoc/test_rdoc_parser_changelog.rb @@ -14,6 +14,8 @@ class TestRDocParserChangeLog < RDoc::TestCase def teardown @tempfile.close! + + super end def test_class_can_parse diff --git a/test/rdoc/test_rdoc_ri_driver.rb b/test/rdoc/test_rdoc_ri_driver.rb index 1a8ac3dde5..e62323338b 100644 --- a/test/rdoc/test_rdoc_ri_driver.rb +++ b/test/rdoc/test_rdoc_ri_driver.rb @@ -33,11 +33,11 @@ class TestRDocRIDriver < RDoc::TestCase end def teardown - super - ENV['HOME'] = @orig_home ENV['RI'] = @orig_ri FileUtils.rm_rf @tmpdir + + super end DUMMY_PAGER = ":;\n" diff --git a/test/rdoc/test_rdoc_ri_paths.rb b/test/rdoc/test_rdoc_ri_paths.rb index 726922daf0..78e1a04f73 100644 --- a/test/rdoc/test_rdoc_ri_paths.rb +++ b/test/rdoc/test_rdoc_ri_paths.rb @@ -36,12 +36,12 @@ class TestRDocRIPaths < RDoc::TestCase end def teardown - super - Gem.use_paths(*@orig_gem_path) Gem::Specification.reset FileUtils.rm_rf @tempdir ENV.replace(@orig_env) + + super end def test_class_each