This repository has been archived on 2024-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
ale/test/test_maven_find_project_root.vader

29 lines
1 KiB
Text
Raw Permalink Normal View History

2019-12-16 00:18:13 +00:00
Before:
call ale#test#SetDirectory('/testplugin/test')
runtime ale_linters/kotlin/javac.vim
After:
call ale#test#RestoreDirectory()
call ale#linter#Reset()
Execute(Should return directory for 'mvnw' if found in parent directory):
call ale#test#SetFilename('maven-test-files/maven-java-project/module1/src/main/java/dummy1.java')
AssertEqual
\ ale#path#Simplify(g:dir . '/maven-test-files/maven-java-project/module1'),
\ ale#maven#FindProjectRoot(bufnr(''))
Execute(Should return directory for 'pom.xml' if found in parent directory):
call ale#test#SetFilename('maven-test-files/maven-java-project/module2/src/main/java/dummy2.java')
AssertEqual
\ ale#path#Simplify(g:dir . '/maven-test-files/maven-java-project/module2'),
\ ale#maven#FindProjectRoot(bufnr(''))
Execute(Should return empty string if maven files are not found in parent directory):
call ale#test#SetFilename('maven-test-files/non-maven-project/src/main/java/dummy.java')
AssertEqual
\ '',
\ ale#maven#FindProjectRoot(bufnr(''))