neovim 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +3 -1
- data/.rubocop.yml +118 -0
- data/.travis.yml +1 -1
- data/CHANGELOG.md +5 -0
- data/Rakefile +29 -16
- data/VimFlavor +1 -0
- data/appveyor.yml +2 -0
- data/lib/neovim/api.rb +2 -1
- data/lib/neovim/buffer.rb +7 -15
- data/lib/neovim/client.rb +3 -3
- data/lib/neovim/connection.rb +6 -7
- data/lib/neovim/event_loop.rb +3 -3
- data/lib/neovim/executable.rb +1 -0
- data/lib/neovim/host.rb +12 -12
- data/lib/neovim/line_range.rb +16 -16
- data/lib/neovim/logging.rb +14 -14
- data/lib/neovim/message.rb +7 -7
- data/lib/neovim/plugin/dsl.rb +4 -4
- data/lib/neovim/plugin/handler.rb +3 -3
- data/lib/neovim/remote_object.rb +3 -3
- data/lib/neovim/ruby_provider.rb +11 -15
- data/lib/neovim/ruby_provider/buffer_ext.rb +1 -0
- data/lib/neovim/ruby_provider/vim.rb +14 -2
- data/lib/neovim/ruby_provider/window_ext.rb +1 -0
- data/lib/neovim/session.rb +7 -10
- data/lib/neovim/version.rb +1 -1
- data/lib/neovim/window.rb +3 -3
- data/neovim.gemspec +5 -4
- data/script/{dump_api → dump_api.rb} +0 -0
- data/script/{generate_docs → generate_docs.rb} +0 -0
- data/script/{j2mp → j2mp.rb} +0 -0
- data/script/{mp2j → mp2j.rb} +0 -0
- data/script/run_acceptance.rb +35 -0
- data/script/validate_docs.rb +29 -0
- data/spec/acceptance/rplugin_autocmd_spec.vim +20 -10
- data/spec/acceptance/rplugin_command_spec.vim +54 -56
- data/spec/acceptance/rplugin_function_spec.vim +28 -22
- data/spec/acceptance/ruby_spec.vim +40 -48
- data/spec/acceptance/rubydo_spec.vim +40 -52
- data/spec/acceptance/rubyfile/nested.rb +1 -1
- data/spec/acceptance/rubyfile_spec.vim +57 -63
- data/spec/acceptance/runtime/init.vim +4 -3
- data/spec/acceptance/runtime/rplugin/ruby/autocmds.rb +6 -2
- data/spec/acceptance/runtime/rplugin/ruby/commands.rb +17 -16
- data/spec/acceptance/runtime/rplugin/ruby/functions.rb +8 -8
- data/spec/helper.rb +2 -2
- data/spec/neovim/api_spec.rb +1 -1
- data/spec/neovim/client_spec.rb +10 -10
- data/spec/neovim/connection_spec.rb +5 -6
- data/spec/neovim/current_spec.rb +12 -12
- data/spec/neovim/executable_spec.rb +2 -2
- data/spec/neovim/host/loader_spec.rb +2 -2
- data/spec/neovim/host_spec.rb +7 -7
- data/spec/neovim/line_range_spec.rb +16 -16
- data/spec/neovim/logging_spec.rb +7 -7
- data/spec/neovim/plugin_spec.rb +6 -6
- data/spec/neovim/ruby_provider/buffer_ext_spec.rb +2 -2
- data/spec/neovim/ruby_provider/vim_spec.rb +4 -4
- data/spec/neovim/ruby_provider/window_ext_spec.rb +8 -8
- data/spec/neovim/session_spec.rb +8 -8
- data/spec/neovim/window_spec.rb +0 -1
- metadata +41 -27
- data/.gitmodules +0 -3
- data/.rspec +0 -1
- data/spec/acceptance/runtime/vader.vim/autoload/vader.vim +0 -348
- data/spec/acceptance/runtime/vader.vim/autoload/vader/assert.vim +0 -116
- data/spec/acceptance/runtime/vader.vim/autoload/vader/helper.vim +0 -43
- data/spec/acceptance/runtime/vader.vim/autoload/vader/parser.vim +0 -179
- data/spec/acceptance/runtime/vader.vim/autoload/vader/syntax.vim +0 -73
- data/spec/acceptance/runtime/vader.vim/autoload/vader/window.vim +0 -205
- data/spec/acceptance/runtime/vader.vim/plugin/vader.vim +0 -37
- data/spec/acceptance_spec.rb +0 -85
@@ -1,75 +1,63 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
two
|
4
|
-
three
|
5
|
-
four
|
1
|
+
let s:suite = themis#suite(":rubydo")
|
2
|
+
let s:expect = themis#helper("expect")
|
6
3
|
|
7
|
-
|
4
|
+
function! s:suite.before_each() abort
|
5
|
+
1,$delete
|
6
|
+
call append(0, ["one", "two", "three", "four"])
|
7
|
+
endfunction
|
8
|
+
|
9
|
+
function! s:suite.has_nvim() abort
|
10
|
+
call s:expect(has("nvim")).to_equal(1)
|
11
|
+
endfunction
|
12
|
+
|
13
|
+
function! s:suite.updates_one_line() abort
|
8
14
|
2rubydo $_.upcase!
|
9
15
|
|
10
|
-
|
11
|
-
|
12
|
-
TWO
|
13
|
-
three
|
14
|
-
four
|
16
|
+
call s:expect(getline(1, 4)).to_equal(["one", "TWO", "three", "four"])
|
17
|
+
endfunction
|
15
18
|
|
16
|
-
|
19
|
+
function! s:suite.updates_line_range() abort
|
17
20
|
2,3rubydo $_.upcase!
|
18
21
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
22
|
+
call s:expect(getline(1, 4)).to_equal(["one", "TWO", "THREE", "four"])
|
23
|
+
endfunction
|
24
|
+
|
25
|
+
function! s:suite.updates_large_line_range() abort
|
26
|
+
1,$delete
|
27
|
+
|
28
|
+
for _ in range(0, 6000)
|
29
|
+
call append(0, "x")
|
30
|
+
endfor
|
31
|
+
|
32
|
+
%rubydo $_.succ!
|
33
|
+
|
34
|
+
call s:expect(getline(1)).to_equal("y")
|
35
|
+
call s:expect(getline(6001)).to_equal("y")
|
36
|
+
call s:expect(getline(6002)).to_equal("")
|
37
|
+
endfunction
|
24
38
|
|
25
|
-
|
39
|
+
function! s:suite.updates_all_lines() abort
|
26
40
|
%rubydo $_.upcase!
|
27
41
|
|
28
|
-
|
29
|
-
|
30
|
-
TWO
|
31
|
-
THREE
|
32
|
-
FOUR
|
42
|
+
call s:expect(getline(1, 4)).to_equal(["ONE", "TWO", "THREE", "FOUR"])
|
43
|
+
endfunction
|
33
44
|
|
34
|
-
|
45
|
+
function! s:suite.handles_standard_error() abort
|
35
46
|
try
|
36
47
|
1rubydo raise "BOOM"
|
37
48
|
throw "Nothing raised"
|
38
49
|
catch /BOOM/
|
39
50
|
endtry
|
40
51
|
|
41
|
-
|
52
|
+
call s:suite.updates_one_line()
|
53
|
+
endfunction
|
42
54
|
|
43
|
-
|
44
|
-
still works
|
45
|
-
two
|
46
|
-
three
|
47
|
-
four
|
48
|
-
|
49
|
-
Execute (Raise a Ruby syntax error):
|
55
|
+
function! s:suite.handles_syntax_error() abort
|
50
56
|
try
|
51
57
|
1rubydo puts[
|
52
58
|
throw "Nothing raised"
|
53
59
|
catch /SyntaxError/
|
54
60
|
endtry
|
55
61
|
|
56
|
-
|
57
|
-
|
58
|
-
Expect:
|
59
|
-
still works
|
60
|
-
two
|
61
|
-
three
|
62
|
-
four
|
63
|
-
|
64
|
-
Given:
|
65
|
-
x
|
66
|
-
|
67
|
-
Execute (Add a large number of lines):
|
68
|
-
1yank
|
69
|
-
silent normal 6000p
|
70
|
-
%rubydo $_.succ!
|
71
|
-
|
72
|
-
Then:
|
73
|
-
AssertEqual "y", getline(1)
|
74
|
-
AssertEqual "y", getline(6001)
|
75
|
-
AssertEqual "", getline(6002)
|
62
|
+
call s:suite.updates_one_line()
|
63
|
+
endfunction
|
@@ -1 +1 @@
|
|
1
|
-
Vim.command("rubyfile ./
|
1
|
+
Vim.command("rubyfile ./nested_inner.rb")
|
@@ -1,46 +1,50 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
let g:nvim_version = api_info()['version']
|
4
|
-
else
|
5
|
-
let g:nvim_version = {'major': 99, 'minor': 99, 'patch': 99}
|
6
|
-
endif
|
1
|
+
let s:suite = themis#suite(":rubyfile")
|
2
|
+
let s:expect = themis#helper("expect")
|
7
3
|
|
8
|
-
|
9
|
-
|
10
|
-
|
4
|
+
function! s:suite.before() abort
|
5
|
+
let g:return_pwd = getcwd()
|
6
|
+
cd spec/acceptance/rubyfile
|
7
|
+
endfunction
|
11
8
|
|
12
|
-
|
13
|
-
|
9
|
+
function! s:suite.after() abort
|
10
|
+
execute("cd " . g:return_pwd)
|
11
|
+
endfunction
|
14
12
|
|
15
|
-
|
16
|
-
|
13
|
+
function! s:suite.before_each() abort
|
14
|
+
1,$delete
|
15
|
+
call append(0, ["one", "two"])
|
16
|
+
endfunction
|
17
17
|
|
18
|
-
|
19
|
-
|
18
|
+
function! s:suite.has_nvim() abort
|
19
|
+
call s:expect(has("nvim")).to_equal(1)
|
20
|
+
endfunction
|
20
21
|
|
21
|
-
|
22
|
-
rubyfile ./
|
22
|
+
function! s:suite.defines_a_ruby_method() abort
|
23
|
+
rubyfile ./define_foo.rb
|
24
|
+
rubyfile ./call_foo.rb
|
23
25
|
|
24
|
-
|
25
|
-
|
26
|
+
call s:expect(g:called).to_equal(1)
|
27
|
+
endfunction
|
26
28
|
|
27
|
-
|
28
|
-
|
29
|
+
function! s:suite.persists_curbuf_state() abort
|
30
|
+
rubyfile ./curbuf_ivar_set.rb
|
31
|
+
rubyfile ./curbuf_ivar_get.rb
|
29
32
|
|
30
|
-
|
31
|
-
|
33
|
+
call s:expect(g:foo).to_equal(123)
|
34
|
+
endfunction
|
35
|
+
|
36
|
+
function! s:suite.updates_working_directory() abort
|
37
|
+
let g:rubyfile = getcwd() . "/set_pwd_before.rb"
|
32
38
|
cd /
|
33
39
|
exec "rubyfile " . g:rubyfile
|
34
40
|
cd -
|
35
41
|
|
36
|
-
|
37
|
-
|
38
|
-
AssertEqual "/", g:pwd_before
|
39
|
-
endif
|
42
|
+
call s:expect(g:pwd_before).to_equal("/")
|
43
|
+
endfunction
|
40
44
|
|
41
|
-
|
42
|
-
let g:before_file = getcwd() . "/
|
43
|
-
let g:after_file = getcwd() . "/
|
45
|
+
function! s:suite.updates_working_directory_implicitly() abort
|
46
|
+
let g:before_file = getcwd() . "/set_pwd_before.rb"
|
47
|
+
let g:after_file = getcwd() . "/set_pwd_after.rb"
|
44
48
|
|
45
49
|
split | lcd /
|
46
50
|
exec "rubyfile " . g:before_file
|
@@ -48,55 +52,45 @@ Execute (Change the working directory implicitly):
|
|
48
52
|
exec "rubyfile " . g:after_file
|
49
53
|
wincmd p | lcd -
|
50
54
|
|
51
|
-
|
52
|
-
|
53
|
-
AssertNotEqual g:pwd_before, g:pwd_after
|
54
|
-
endif
|
55
|
+
call s:expect(g:pwd_before).not.to_equal(g:pwd_after)
|
56
|
+
endfunction
|
55
57
|
|
56
|
-
|
57
|
-
rubyfile ./
|
58
|
+
function! s:suite.supports_nesting() abort
|
59
|
+
rubyfile ./nested.rb
|
58
60
|
|
59
|
-
|
60
|
-
|
61
|
+
call s:expect(g:ruby_nested).to_equal(123)
|
62
|
+
endfunction
|
61
63
|
|
62
|
-
|
64
|
+
function! s:suite.handles_standard_error() abort
|
63
65
|
try
|
64
|
-
rubyfile
|
66
|
+
rubyfile ./raise_standard_error.rb
|
65
67
|
throw "Nothing raised"
|
66
|
-
catch /
|
68
|
+
catch /BOOM/
|
67
69
|
endtry
|
68
70
|
|
69
|
-
|
70
|
-
|
71
|
-
Expect:
|
72
|
-
still works
|
73
|
-
two
|
71
|
+
call s:suite.defines_a_ruby_method()
|
72
|
+
endfunction
|
74
73
|
|
75
|
-
|
74
|
+
function! s:suite.handles_load_error() abort
|
76
75
|
try
|
77
|
-
rubyfile
|
76
|
+
rubyfile /foo/bar/baz
|
78
77
|
throw "Nothing raised"
|
79
|
-
catch /
|
78
|
+
catch /LoadError/
|
80
79
|
endtry
|
81
80
|
|
82
|
-
|
81
|
+
call s:suite.defines_a_ruby_method()
|
82
|
+
endfunction
|
83
83
|
|
84
|
-
|
85
|
-
still works
|
86
|
-
two
|
87
|
-
|
88
|
-
Execute (Raise a Ruby syntax error):
|
84
|
+
function! s:suite.handles_syntax_error() abort
|
89
85
|
try
|
90
|
-
rubyfile ./
|
86
|
+
rubyfile ./raise_syntax_error.rb
|
91
87
|
throw "Nothing raised"
|
92
88
|
catch /SyntaxError/
|
93
89
|
endtry
|
94
90
|
|
95
|
-
|
96
|
-
|
97
|
-
Expect:
|
98
|
-
still works
|
99
|
-
two
|
91
|
+
call s:suite.defines_a_ruby_method()
|
92
|
+
endfunction
|
100
93
|
|
101
|
-
|
102
|
-
rubyfile ./
|
94
|
+
function! s:suite.exposes_constants() abort
|
95
|
+
rubyfile ./ruby_interface.rb
|
96
|
+
endfunction
|
@@ -1,8 +1,9 @@
|
|
1
|
-
let s:lib_path =
|
2
|
-
let s:bin_path =
|
1
|
+
let s:lib_path = getcwd() . "/lib"
|
2
|
+
let s:bin_path = getcwd() . "/bin/neovim-ruby-host"
|
3
|
+
let g:acceptance_rtp = getcwd() . "/spec/acceptance/runtime"
|
3
4
|
let g:ruby_host_prog = printf("ruby -I %s %s", s:lib_path, s:bin_path)
|
4
5
|
|
5
6
|
ruby require "rspec/expectations"
|
6
7
|
ruby include ::RSpec::Matchers.dup
|
7
8
|
|
8
|
-
set rtp=./runtime
|
9
|
+
set rtp=./spec/acceptance/runtime,$VIMRUNTIME
|
@@ -1,9 +1,13 @@
|
|
1
1
|
Neovim.plugin do |plug|
|
2
|
-
plug.autocmd(:BufEnter, pattern: "*.rb") do |nvim|
|
2
|
+
plug.autocmd(:BufEnter, pattern: "*.rb", sync: true) do |nvim|
|
3
3
|
nvim.get_current_buf.set_var("rplugin_autocmd_BufEnter", true)
|
4
4
|
end
|
5
5
|
|
6
|
-
plug.autocmd(:BufEnter, pattern: "*.c", eval: "g:to_eval") do |nvim, to_eval|
|
6
|
+
plug.autocmd(:BufEnter, pattern: "*.c", eval: "g:to_eval", sync: true) do |nvim, to_eval|
|
7
7
|
nvim.set_var("rplugin_autocmd_BufEnter_eval", to_eval.merge(b: 43))
|
8
8
|
end
|
9
|
+
|
10
|
+
plug.autocmd(:BufEnter, pattern: "*.async") do |nvim, to_eval|
|
11
|
+
nvim.set_var("rplugin_autocmd_BufEnter_async", true)
|
12
|
+
end
|
9
13
|
end
|
@@ -1,63 +1,64 @@
|
|
1
1
|
Neovim.plugin do |plug|
|
2
|
-
plug.command(:RPluginCommandNargs0) do |nvim|
|
2
|
+
plug.command(:RPluginCommandNargs0, sync: true) do |nvim|
|
3
3
|
nvim.set_var("rplugin_command_nargs_0", true)
|
4
4
|
end
|
5
5
|
|
6
|
-
plug.command(:RPluginCommandNargs1, nargs: 1) do |nvim, arg|
|
6
|
+
plug.command(:RPluginCommandNargs1, nargs: 1, sync: true) do |nvim, arg|
|
7
7
|
nvim.set_var("rplugin_command_nargs_1", arg)
|
8
8
|
end
|
9
9
|
|
10
|
-
plug.command(:RPluginCommandNargsN, nargs: "*") do |nvim, *args|
|
10
|
+
plug.command(:RPluginCommandNargsN, nargs: "*", sync: true) do |nvim, *args|
|
11
11
|
nvim.set_var("rplugin_command_nargs_n", args)
|
12
12
|
end
|
13
13
|
|
14
|
-
plug.command(:RPluginCommandNargsQ, nargs: "?") do |nvim, arg|
|
14
|
+
plug.command(:RPluginCommandNargsQ, nargs: "?", sync: true) do |nvim, arg|
|
15
15
|
nvim.set_var("rplugin_command_nargs_q", arg)
|
16
16
|
end
|
17
17
|
|
18
|
-
plug.command(:RPluginCommandNargsP, nargs: "+") do |nvim, *args|
|
18
|
+
plug.command(:RPluginCommandNargsP, nargs: "+", sync: true) do |nvim, *args|
|
19
19
|
nvim.set_var("rplugin_command_nargs_p", args)
|
20
20
|
end
|
21
21
|
|
22
|
-
plug.command(:RPluginCommandRange, range: true) do |nvim, *range|
|
22
|
+
plug.command(:RPluginCommandRange, range: true, sync: true) do |nvim, *range|
|
23
23
|
nvim.set_var("rplugin_command_range", range)
|
24
24
|
end
|
25
25
|
|
26
|
-
plug.command(:RPluginCommandRangeP, range: "%") do |nvim, *range|
|
26
|
+
plug.command(:RPluginCommandRangeP, range: "%", sync: true) do |nvim, *range|
|
27
27
|
nvim.set_var("rplugin_command_range_p", range)
|
28
28
|
end
|
29
29
|
|
30
|
-
plug.command(:RPluginCommandRangeN, range: 1) do |nvim, *range|
|
30
|
+
plug.command(:RPluginCommandRangeN, range: 1, sync: true) do |nvim, *range|
|
31
31
|
nvim.set_var("rplugin_command_range_n", range)
|
32
32
|
end
|
33
33
|
|
34
|
-
plug.command(:RPluginCommandCountN, count: 1) do |nvim, *count|
|
34
|
+
plug.command(:RPluginCommandCountN, count: 1, sync: true) do |nvim, *count|
|
35
35
|
nvim.set_var("rplugin_command_count_n", count)
|
36
36
|
end
|
37
37
|
|
38
|
-
plug.command(:RPluginCommandBang, bang: true) do |nvim, bang|
|
38
|
+
plug.command(:RPluginCommandBang, bang: true, sync: true) do |nvim, bang|
|
39
39
|
nvim.set_var("rplugin_command_bang", bang)
|
40
40
|
end
|
41
41
|
|
42
|
-
plug.command(:RPluginCommandRegister, register: true) do |nvim, reg|
|
42
|
+
plug.command(:RPluginCommandRegister, register: true, sync: true) do |nvim, reg|
|
43
43
|
nvim.set_var("rplugin_command_register", reg)
|
44
44
|
end
|
45
45
|
|
46
|
-
plug.command(:RPluginCommandCompletion, complete: "buffer") do |nvim|
|
46
|
+
plug.command(:RPluginCommandCompletion, complete: "buffer", sync: true) do |nvim|
|
47
47
|
attrs = nvim.command_output("silent command RPluginCommandCompletion")
|
48
48
|
compl = attrs.split($/).last.split[2]
|
49
49
|
nvim.set_var("rplugin_command_completion", compl)
|
50
50
|
end
|
51
51
|
|
52
|
-
plug.command(:RPluginCommandEval, eval: "g:to_eval") do |nvim, to_eval|
|
52
|
+
plug.command(:RPluginCommandEval, eval: "g:to_eval", sync: true) do |nvim, to_eval|
|
53
53
|
nvim.set_var("rplugin_command_eval", to_eval.merge(b: 43))
|
54
|
+
to_eval.merge(b: 43)
|
54
55
|
end
|
55
56
|
|
56
|
-
plug.command(:
|
57
|
-
nvim.set_var("
|
57
|
+
plug.command(:RPluginCommandAsync) do |nvim|
|
58
|
+
nvim.set_var("rplugin_command_async", true)
|
58
59
|
end
|
59
60
|
|
60
|
-
plug.command(:RPluginCommandRecursive,
|
61
|
+
plug.command(:RPluginCommandRecursive, nargs: 1, sync: true) do |nvim, n|
|
61
62
|
if Integer(n) >= 10
|
62
63
|
nvim.set_var("rplugin_command_recursive", n)
|
63
64
|
else
|
@@ -1,18 +1,18 @@
|
|
1
1
|
Neovim.plugin do |plug|
|
2
|
-
plug.function(:RPluginFunctionArgs) do |nvim, *args|
|
3
|
-
|
2
|
+
plug.function(:RPluginFunctionArgs, sync: true) do |nvim, *args|
|
3
|
+
args
|
4
4
|
end
|
5
5
|
|
6
|
-
plug.function(:RPluginFunctionRange, range: true) do |nvim,
|
7
|
-
nvim.set_var("rplugin_function_range",
|
6
|
+
plug.function(:RPluginFunctionRange, range: true, sync: true) do |nvim, start, stop|
|
7
|
+
nvim.set_var("rplugin_function_range", [start, stop])
|
8
8
|
end
|
9
9
|
|
10
|
-
plug.function(:RPluginFunctionEval, eval: "g:to_eval") do |nvim, to_eval|
|
11
|
-
|
10
|
+
plug.function(:RPluginFunctionEval, eval: "g:to_eval", sync: true) do |nvim, to_eval|
|
11
|
+
to_eval.merge(b: 43)
|
12
12
|
end
|
13
13
|
|
14
|
-
plug.function(:
|
15
|
-
true
|
14
|
+
plug.function(:RPluginFunctionAsync) do |nvim|
|
15
|
+
nvim.set_var("rplugin_function_async", true)
|
16
16
|
end
|
17
17
|
|
18
18
|
plug.function(:RPluginFunctionRecursive, sync: true, nargs: 1) do |nvim, n|
|
data/spec/helper.rb
CHANGED
@@ -6,13 +6,13 @@ if ENV["REPORT_COVERAGE"]
|
|
6
6
|
end
|
7
7
|
|
8
8
|
require "fileutils"
|
9
|
+
require "msgpack"
|
9
10
|
require "neovim"
|
10
11
|
require "pry"
|
11
12
|
require "rubygems"
|
13
|
+
require "securerandom"
|
12
14
|
require "stringio"
|
13
15
|
require "timeout"
|
14
|
-
require "securerandom"
|
15
|
-
require "msgpack"
|
16
16
|
|
17
17
|
require File.expand_path("../support.rb", __FILE__)
|
18
18
|
|
data/spec/neovim/api_spec.rb
CHANGED
data/spec/neovim/client_spec.rb
CHANGED
@@ -7,21 +7,21 @@ module Neovim
|
|
7
7
|
|
8
8
|
describe "#set_option" do
|
9
9
|
it "sets an option from two arguments" do
|
10
|
-
expect
|
10
|
+
expect do
|
11
11
|
client.set_option("makeprg", "rake")
|
12
|
-
|
12
|
+
end.to change { client.evaluate("&makeprg") }.to("rake")
|
13
13
|
end
|
14
14
|
|
15
15
|
it "sets an option from a string" do
|
16
|
-
expect
|
16
|
+
expect do
|
17
17
|
client.set_option("timeoutlen=0")
|
18
|
-
|
18
|
+
end.to change { client.evaluate("&timeoutlen") }.to(0)
|
19
19
|
end
|
20
20
|
|
21
21
|
it "sets a boolean option" do
|
22
|
-
expect
|
22
|
+
expect do
|
23
23
|
client.set_option("expandtab")
|
24
|
-
|
24
|
+
end.to change { client.evaluate("&expandtab") }.to(1)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -45,15 +45,15 @@ module Neovim
|
|
45
45
|
end
|
46
46
|
|
47
47
|
it "raises exceptions for unknown methods" do
|
48
|
-
expect
|
48
|
+
expect do
|
49
49
|
client.foobar
|
50
|
-
|
50
|
+
end.to raise_error(NoMethodError)
|
51
51
|
end
|
52
52
|
|
53
53
|
it "raises exceptions for incorrect usage" do
|
54
|
-
expect
|
54
|
+
expect do
|
55
55
|
client.strwidth("too", "many")
|
56
|
-
|
56
|
+
end.to raise_error("Wrong number of arguments: expecting 1 but got 2")
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|