#427 Add a function for looking up ALE variables in buffer scope, and then global scope

This commit is contained in:
w0rp
2017-04-16 00:16:48 +01:00
parent 7682fab294
commit e80116cee0
2 changed files with 27 additions and 0 deletions

16
test/test_ale_var.vader Normal file
View File

@@ -0,0 +1,16 @@
Before:
let g:ale_some_variable = 'abc'
After:
unlet! g:ale_some_variable
Execute(ale#Var should return global variables):
AssertEqual 'abc', ale#Var(bufnr(''), 'some_variable')
Execute(ale#Var should return buffer overrides):
let b:ale_some_variable = 'def'
AssertEqual 'def', ale#Var(bufnr(''), 'some_variable')
Execute(ale#Var should throw exceptions for undefined variables):
AssertThrows call ale#Var(bufnr(''), 'undefined_variable_name')