summaryrefslogtreecommitdiff
path: root/test/test_bingo_find_project_root.vader
blob: 540183d0f97d2ae9a85cf502b6fac3246fe3c730 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Before:
  call ale#test#SetDirectory('/testplugin/test')
  runtime ale_linters/go/bingo.vim

After:
  call ale#test#RestoreDirectory()
  call ale#linter#Reset()

Execute(Should return directory for 'go.mod' if found in parent directory):
  call ale#test#SetFilename('go_files/test.go')

  AssertEqual
  \ ale#path#Simplify(g:dir . '/go_files'),
  \ ale_linters#go#bingo#FindProjectRoot(bufnr(''))

Execute(Should return nearest directory with '.git' if found in parent directory):
  call ale#test#SetFilename('test.go')

  AssertEqual
  \ fnamemodify(ale#path#Simplify('/testplugin'), ':p:h'),
  \ ale_linters#go#bingo#FindProjectRoot(bufnr(''))