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

Add --no-mouse option to replace FZF_MOUSE_ENABLED

This commit is contained in:
Junegunn Choi
2014-01-30 15:41:44 +09:00
parent f2b2c022be
commit c7e86ad4f1
3 changed files with 14 additions and 8 deletions

View File

@@ -20,6 +20,7 @@ class TestFZF < MiniTest::Unit::TestCase
assert_equal false, fzf.multi
assert_equal true, fzf.color
assert_equal nil, fzf.rxflag
assert_equal true, fzf.mouse
end
def test_environment_variables
@@ -28,7 +29,7 @@ class TestFZF < MiniTest::Unit::TestCase
fzf = FZF.new []
assert_equal 20000, fzf.sort
ENV['FZF_DEFAULT_OPTS'] = '-x -m -s 10000 -q " hello world " +c'
ENV['FZF_DEFAULT_OPTS'] = '-x -m -s 10000 -q " hello world " +c --no-mouse'
fzf = FZF.new []
assert_equal 10000, fzf.sort
assert_equal ' hello world ',
@@ -36,14 +37,16 @@ class TestFZF < MiniTest::Unit::TestCase
assert_equal true, fzf.extended
assert_equal true, fzf.multi
assert_equal false, fzf.color
assert_equal false, fzf.mouse
end
def test_option_parser
# Long opts
fzf = FZF.new %w[--sort=2000 --no-color --multi +i --query hello --extended]
fzf = FZF.new %w[--sort=2000 --no-color --multi +i --query hello --extended --no-mouse]
assert_equal 2000, fzf.sort
assert_equal true, fzf.multi
assert_equal false, fzf.color
assert_equal false, fzf.mouse
assert_equal 0, fzf.rxflag
assert_equal 'hello', fzf.query.get
assert_equal true, fzf.extended
@@ -53,6 +56,7 @@ class TestFZF < MiniTest::Unit::TestCase
assert_equal nil, fzf.sort
assert_equal false, fzf.multi
assert_equal true, fzf.color
assert_equal true, fzf.mouse
assert_equal 1, fzf.rxflag
assert_equal 'hello', fzf.query.get
assert_equal false, fzf.extended