mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-17 07:43:39 -05:00
Add GET endpoints for getting the state of the finder
* GET / (or GET /current) * GET /query
This commit is contained in:
@@ -2440,9 +2440,12 @@ class TestGoFZF < TestBase
|
||||
def test_listen
|
||||
tmux.send_keys 'seq 10 | fzf --listen 6266', :Enter
|
||||
tmux.until { |lines| assert_equal 10, lines.item_count }
|
||||
Net::HTTP.post(URI('http://localhost:6266'), 'change-query(yo)+reload(seq 100)+change-prompt:hundred> ')
|
||||
Net::HTTP.post(URI('http://localhost:6266'), 'change-query(00)+reload(seq 100)+change-prompt:hundred> ')
|
||||
tmux.until { |lines| assert_equal 100, lines.item_count }
|
||||
tmux.until { |lines| assert_equal 'hundred> yo', lines[-1] }
|
||||
tmux.until { |lines| assert_equal 'hundred> 00', lines[-1] }
|
||||
assert_equal '100', Net::HTTP.get(URI('http://localhost:6266'))
|
||||
assert_equal '100', Net::HTTP.get(URI('http://localhost:6266/current'))
|
||||
assert_equal '00', Net::HTTP.get(URI('http://localhost:6266/query'))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user