Fix test failure - use absolute path
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Junegunn Choi · committed by Junegunn Choi · parent e1df876 · Browse files · 1 file·+9 added−8 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+9 added−8 removed
- tests:+9 added−8 removed
Provenance
- Commit
7bcf4ef- Tree
2ffe500- Author
Junegunn Choi <junegunn.c@gmail.com>- Committer
Junegunn Choi <junegunn.c@gmail.com>- Parent
e1df876
1 file changed+9 added−8 removed
modified:test/test_go.rb+9 added-8 removed
4 unmodified lines5 require 'fileutils'6 7 DEFAULT_TIMEOUT = 208 9+FILE = File.expand_path(__FILE__)10 base = File.expand_path('../../', __FILE__)11 Dir.chdir base12 FZF = "FZF_DEFAULT_OPTS= FZF_DEFAULT_COMMAND= #{base}/bin/fzf"13 789 unmodified lines803 assert_equal '6', readonce.chomp804 end805 806 def test_header806- tmux.send_keys "seq 100 | #{fzf "--header \\\"\\$(head -5 #{__FILE__})\\\""}", :Enter807- header = File.readlines(__FILE__).take(5).map(&:strip)807+ tmux.send_keys "seq 100 | #{fzf "--header \\\"\\$(head -5 #{FILE})\\\""}", :Enter808+ header = File.readlines(FILE).take(5).map(&:strip)809 tmux.until do |lines|810 lines[-2].include?('100/100') &&811 lines[-7..-3].map(&:strip) == header812 end813 end814 815 def test_header_reverse815- tmux.send_keys "seq 100 | #{fzf "--header=\\\"\\$(head -5 #{__FILE__})\\\" --reverse"}", :Enter816- header = File.readlines(__FILE__).take(5).map(&:strip)816+ tmux.send_keys "seq 100 | #{fzf "--header=\\\"\\$(head -5 #{FILE})\\\" --reverse"}", :Enter817+ header = File.readlines(FILE).take(5).map(&:strip)818 tmux.until do |lines|819 lines[1].include?('100/100') &&820 lines[2..6].map(&:strip) == header821 end822 end823 824 def test_header_and_header_lines824- tmux.send_keys "seq 100 | #{fzf "--header-lines 10 --header \\\"\\$(head -5 #{__FILE__})\\\""}", :Enter825- header = File.readlines(__FILE__).take(5).map(&:strip)825+ tmux.send_keys "seq 100 | #{fzf "--header-lines 10 --header \\\"\\$(head -5 #{FILE})\\\""}", :Enter826+ header = File.readlines(FILE).take(5).map(&:strip)827 tmux.until do |lines|828 lines[-2].include?('90/90') &&829 lines[-7...-2].map(&:strip) == header &&830 lines[-17...-7].map(&:strip) == (1..10).map(&:to_s).reverse831 end832 end833 834 def test_header_and_header_lines_reverse834- tmux.send_keys "seq 100 | #{fzf "--reverse --header-lines 10 --header \\\"\\$(head -5 #{__FILE__})\\\""}", :Enter835- header = File.readlines(__FILE__).take(5).map(&:strip)835+ tmux.send_keys "seq 100 | #{fzf "--reverse --header-lines 10 --header \\\"\\$(head -5 #{FILE})\\\""}", :Enter836+ header = File.readlines(FILE).take(5).map(&:strip)837 tmux.until do |lines|838 lines[1].include?('90/90') &&839 lines[2...7].map(&:strip) == header &&840 lines[7...17].map(&:strip) == (1..10).map(&:to_s)359 unmodified lines