Skip to content

Commit af8818d

Browse files
authored
fix tesself_find_files_with_gemfile since it depends on local environments
1 parent adfcf40 commit af8818d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/rubygems/test_gem.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ def test_self_find_files_with_gemfile
492492
skip if RUBY_VERSION <= "1.8.7"
493493

494494
cwd = File.expand_path("test/rubygems", @@project_dir)
495-
$LOAD_PATH.unshift cwd
495+
actual_load_path = $LOAD_PATH.unshift(cwd).dup
496496

497497
discover_path = File.join 'lib', 'sff', 'discover.rb'
498498

@@ -518,12 +518,12 @@ def test_self_find_files_with_gemfile
518518
expected = [
519519
File.expand_path('test/rubygems/sff/discover.rb', @@project_dir),
520520
File.join(foo1.full_gem_path, discover_path)
521-
]
521+
].sort
522522

523-
assert_equal expected, Gem.find_files('sff/discover')
524-
assert_equal expected, Gem.find_files('sff/**.rb'), '[ruby-core:31730]'
523+
assert_equal expected, Gem.find_files('sff/discover').sort
524+
assert_equal expected, Gem.find_files('sff/**.rb').sort, '[ruby-core:31730]'
525525
ensure
526-
assert_equal cwd, $LOAD_PATH.shift unless RUBY_VERSION <= "1.8.7"
526+
assert_equal cwd, actual_load_path.shift unless RUBY_VERSION <= "1.8.7"
527527
end
528528

529529
def test_self_find_latest_files

0 commit comments

Comments
 (0)