forked from vim-test/vim-test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdotnet_spec.vim
69 lines (50 loc) · 1.71 KB
/
dotnet_spec.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
source spec/support/helpers.vim
function! s:remove_path(cmd)
return substitute(a:cmd, '\/.*\/spec\/fixtures\/dotnet\/', '', '')
endfunction
describe "DotnetTest"
before
cd spec/fixtures/dotnet
end
after
call Teardown()
cd -
end
it "runs nearest tests for file namespace"
view +6 FileNamespaceTests.cs
TestNearest
let actual = s:remove_path(g:test#last_command)
Expect actual == 'dotnet test Tests.csproj --filter FullyQualifiedName=Namespace.Tests.TestAsyncWithTaskReturn'
end
it "runs nearest tests"
view +3 Tests.cs
TestNearest
let actual = s:remove_path(g:test#last_command)
Expect actual == 'dotnet test Tests.csproj --filter FullyQualifiedName~Namespace.Tests'
view +8 Tests.cs
TestNearest
let actual = s:remove_path(g:test#last_command)
Expect actual == 'dotnet test Tests.csproj --filter FullyQualifiedName=Namespace.Tests.TestAsync'
view +14 Tests.cs
TestNearest
let actual = s:remove_path(g:test#last_command)
Expect actual == 'dotnet test Tests.csproj --filter FullyQualifiedName=Namespace.Tests.Test'
view +20 Tests.cs
TestNearest
let actual = s:remove_path(g:test#last_command)
Expect actual == 'dotnet test Tests.csproj --filter FullyQualifiedName=Namespace.Tests.TestAsyncWithTaskReturn'
end
it "runs file test if nearest test couldn't be found"
view +2 Tests.cs
normal O
TestNearest
let actual = s:remove_path(g:test#last_command)
Expect actual == 'dotnet test Tests.csproj --filter FullyQualifiedName~Namespace'
end
it "runs test suites"
view Tests.cs
TestSuite
let actual = s:remove_path(g:test#last_command)
Expect actual == 'dotnet test Tests.csproj'
end
end