File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,14 +93,19 @@ def test_indexable_uris_does_not_include_gems_own_installed_files
9393 end
9494
9595 def test_indexable_uris_does_not_include_non_ruby_files_inside_rubylibdir
96- path = Pathname . new ( RbConfig ::CONFIG [ "rubylibdir" ] ) . join ( "extra_file.txt" ) . to_s
97- FileUtils . touch ( path )
96+ Dir . mktmpdir do |dir |
97+ original_rubylibdir = RbConfig ::CONFIG [ "rubylibdir" ]
98+ RbConfig ::CONFIG [ "rubylibdir" ] = dir
9899
99- begin
100- uris = @config . indexable_uris
101- assert ( uris . none? { |uri | uri . full_path == path } )
102- ensure
103- FileUtils . rm ( path )
100+ begin
101+ path = Pathname . new ( dir ) . join ( "extra_file.txt" ) . to_s
102+ FileUtils . touch ( path )
103+
104+ uris = @config . indexable_uris
105+ assert ( uris . none? { |uri | uri . full_path == path } )
106+ ensure
107+ RbConfig ::CONFIG [ "rubylibdir" ] = original_rubylibdir
108+ end
104109 end
105110 end
106111
You can’t perform that action at this time.
0 commit comments