Mercurial > dotfiles
comparison .zfun/zsh-autosuggestions/spec/options/buffer_max_size_spec.rb @ 467:e1ce8897030d
zsh: import df6f6f9ff41 of zsh-autosuggestions
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Mon, 03 Dec 2018 22:37:29 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
466:f248cf012d9a | 467:e1ce8897030d |
---|---|
1 describe 'a suggestion' do | |
2 let(:term_opts) { { width: 200 } } | |
3 let(:long_command) { "echo #{'a' * 100}" } | |
4 | |
5 around do |example| | |
6 with_history(long_command) { example.run } | |
7 end | |
8 | |
9 it 'is provided for any buffer length' do | |
10 session.send_string(long_command[0...-1]) | |
11 wait_for { session.content }.to eq(long_command) | |
12 end | |
13 | |
14 context 'when ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE is specified' do | |
15 let(:buffer_max_size) { 10 } | |
16 let(:options) { ["ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=#{buffer_max_size}"] } | |
17 | |
18 it 'is provided when the buffer is shorter than the specified length' do | |
19 session.send_string(long_command[0...(buffer_max_size - 1)]) | |
20 wait_for { session.content }.to eq(long_command) | |
21 end | |
22 | |
23 it 'is provided when the buffer is equal to the specified length' do | |
24 session.send_string(long_command[0...(buffer_max_size)]) | |
25 wait_for { session.content }.to eq(long_command) | |
26 end | |
27 | |
28 it 'is not provided when the buffer is longer than the specified length' | |
29 end | |
30 end |