m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-16 15:23:48 -05:00

Change temporary file names to fix flaky tests

This commit is contained in:
Junegunn Choi
2016-01-14 00:41:02 +09:00
parent 8d3a302a17
commit edb647667e

View File

@@ -143,8 +143,10 @@ class TestBase < Minitest::Test
attr_reader :tmux attr_reader :tmux
def tempname def tempname
@temp_suffix ||= 0
[TEMPNAME, [TEMPNAME,
caller_locations.map(&:label).find { |l| l =~ /^test_/ }].join '-' caller_locations.map(&:label).find { |l| l =~ /^test_/ },
@temp_suffix].join '-'
end end
def setup def setup
@@ -158,6 +160,7 @@ class TestBase < Minitest::Test
File.read(tempname) File.read(tempname)
ensure ensure
File.unlink tempname while File.exists?(tempname) File.unlink tempname while File.exists?(tempname)
@temp_suffix += 1
tmux.prepare tmux.prepare
end end