diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-09-06 17:17:37 -0700 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-09-06 17:19:07 -0700 |
commit | 7e1c9598617a140e40a0a22676c0631294617246 (patch) | |
tree | e6988da22f16062b57d50daeda084bcc489a6a1d /test/functional/api/buffer_spec.lua | |
parent | af946046b922dc5d5285a70a23d11916d8389a5d (diff) | |
download | rneovim-7e1c9598617a140e40a0a22676c0631294617246.tar.gz rneovim-7e1c9598617a140e40a0a22676c0631294617246.tar.bz2 rneovim-7e1c9598617a140e40a0a22676c0631294617246.zip |
test: Eliminate expect_err
Eliminate `expect_err` in favor of `pcall_err` + `eq` or `matches`.
Diffstat (limited to 'test/functional/api/buffer_spec.lua')
-rw-r--r-- | test/functional/api/buffer_spec.lua | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/test/functional/api/buffer_spec.lua b/test/functional/api/buffer_spec.lua index 1322daa64d..da7515f012 100644 --- a/test/functional/api/buffer_spec.lua +++ b/test/functional/api/buffer_spec.lua @@ -13,7 +13,6 @@ local NIL = helpers.NIL local command = helpers.command local bufmeths = helpers.bufmeths local feed = helpers.feed -local expect_err = helpers.expect_err local pcall_err = helpers.pcall_err describe('api/buf', function() @@ -191,14 +190,14 @@ describe('api/buf', function() it('fails correctly when input is not valid', function() eq(1, curbufmeths.get_number()) - expect_err([[String cannot contain newlines]], - bufmeths.set_lines, 1, 1, 2, false, {'b\na'}) + eq([[String cannot contain newlines]], + pcall_err(bufmeths.set_lines, 1, 1, 2, false, {'b\na'})) end) it("fails if 'nomodifiable'", function() command('set nomodifiable') - expect_err([[Buffer is not 'modifiable']], - bufmeths.set_lines, 1, 1, 2, false, {'a','b'}) + eq([[Buffer is not 'modifiable']], + pcall_err(bufmeths.set_lines, 1, 1, 2, false, {'a','b'})) end) it('has correct line_count when inserting and deleting', function() |