File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed
Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,13 @@ def test_execute_directory
3838 end
3939
4040 def test_execute_one_missing
41- # TODO: this test fails in isolation
41+ original_gem_home = ENV [ "GEM_HOME" ]
42+ original_gem_path = ENV [ "GEM_PATH" ]
43+
44+ ENV [ "GEM_HOME" ] = @gemhome
45+ ENV [ "GEM_PATH" ] = @gemhome
46+ Gem . use_paths ( @gemhome )
47+ Gem ::Specification . reset
4248
4349 util_foo_bar
4450
@@ -53,6 +59,21 @@ def test_execute_one_missing
5359 assert_equal "#{ @foo_bar . full_gem_path } /lib/foo_bar.rb\n " , @ui . output
5460 assert_match ( /Can.t find Ruby library file or shared library missinglib\n / ,
5561 @ui . error )
62+ ensure
63+ if original_gem_home
64+ ENV [ "GEM_HOME" ] = original_gem_home
65+ else
66+ ENV . delete ( "GEM_HOME" )
67+ end
68+
69+ if original_gem_path
70+ ENV [ "GEM_PATH" ] = original_gem_path
71+ else
72+ ENV . delete ( "GEM_PATH" )
73+ end
74+
75+ Gem . use_paths ( @gemhome )
76+ Gem ::Specification . reset
5677 end
5778
5879 def test_execute_missing
You can’t perform that action at this time.
0 commit comments