File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -647,17 +647,10 @@ def test_execute_rdoc
647647 @cmd . options [ :args ] = %w[ a ]
648648
649649 use_ui @ui do
650- # Don't use Dir.chdir with a block, it warnings a lot because
651- # of a downstream Dir.chdir with a block
652- old = Dir . getwd
653-
654- begin
655- Dir . chdir @tempdir
650+ Dir . chdir @tempdir do
656651 assert_raise Gem ::MockGemUi ::SystemExitException , @ui . error do
657652 @cmd . execute
658653 end
659- ensure
660- Dir . chdir old
661654 end
662655 end
663656
@@ -684,17 +677,10 @@ def test_execute_rdoc_with_path
684677 @cmd . options [ :args ] = %w[ a ]
685678
686679 use_ui @ui do
687- # Don't use Dir.chdir with a block, it warnings a lot because
688- # of a downstream Dir.chdir with a block
689- old = Dir . getwd
690-
691- begin
692- Dir . chdir @tempdir
680+ Dir . chdir @tempdir do
693681 assert_raise Gem ::MockGemUi ::SystemExitException , @ui . error do
694682 @cmd . execute
695683 end
696- ensure
697- Dir . chdir old
698684 end
699685 end
700686
@@ -720,17 +706,10 @@ def test_execute_saves_build_args
720706 @cmd . options [ :args ] = %w[ a ]
721707
722708 use_ui @ui do
723- # Don't use Dir.chdir with a block, it warnings a lot because
724- # of a downstream Dir.chdir with a block
725- old = Dir . getwd
726-
727- begin
728- Dir . chdir @tempdir
709+ Dir . chdir @tempdir do
729710 assert_raise Gem ::MockGemUi ::SystemExitException , @ui . error do
730711 @cmd . execute
731712 end
732- ensure
733- Dir . chdir old
734713 end
735714 end
736715
Original file line number Diff line number Diff line change @@ -382,13 +382,9 @@ def test_install_dependency_existing_extension
382382 FileUtils . mv f1_gem , @tempdir
383383 inst = nil
384384
385- pwd = Dir . getwd
386- Dir . chdir @tempdir
387- begin
385+ Dir . chdir @tempdir do
388386 inst = Gem ::DependencyInstaller . new
389387 inst . install "f"
390- ensure
391- Dir . chdir pwd
392388 end
393389
394390 assert_equal %w[ f-1 ] , inst . installed_gems . map ( &:full_name )
You can’t perform that action at this time.
0 commit comments