Skip to content

Instantly share code, notes, and snippets.

@mhinz
Created June 30, 2016 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhinz/75d9e99a08f1ed1674ef5247c86a8314 to your computer and use it in GitHub Desktop.
Save mhinz/75d9e99a08f1ed1674ef5247c86a8314 to your computer and use it in GitHub Desktop.
-- assert_exception({cmd}, [, {error}])
describe('assert_exception()', function()
it('should assert thrown exceptions properly', function()
source([[
try
nocommand
catch
call assert_exception('E492')
endtry
]])
expected_empty()
end)
it('should work properly when nested', function()
source([[
try
nocommand
catch
try
" illegal argument, get NULL for error
call assert_exception([])
catch
call assert_exception('E730')
endtry
endtry
]])
expected_empty()
end)
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment