forked from vim-test/vim-test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdotnet_xunit_spec.vim
121 lines (86 loc) · 3.02 KB
/
dotnet_xunit_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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
source spec/support/helpers.vim
function! s:remove_path(cmd)
return substitute(a:cmd, '\/.*\/spec\/fixtures\/dotnet-xunit\/', '', '')
endfunction
describe "xUnit"
before
cd spec/fixtures/dotnet-xunit
end
after
call Teardown()
cd -
end
it "runs nearest tests"
view +5 Tests.cs
TestNearest
let actual = s:remove_path(g:test#last_command)
Expect actual == 'dotnet xunit -nologo -class Namespace.Tests'
view +10 Tests.cs
TestNearest
let actual = s:remove_path(g:test#last_command)
Expect actual == 'dotnet xunit -nologo -method Namespace.Tests.TestAsync'
view +16 Tests.cs
TestNearest
let actual = s:remove_path(g:test#last_command)
Expect actual == 'dotnet xunit -nologo -method Namespace.Tests.Test'
end
it "runs nearest nested tests"
view +5 NestedTests.cs
TestNearest
let actual = s:remove_path(g:test#last_command)
Expect actual == 'dotnet xunit -nologo -class Namespace.Parent'
view +7 NestedTests.cs
TestNearest
let actual = s:remove_path(g:test#last_command)
Expect actual == 'dotnet xunit -nologo -class Namespace.Parent.NestedTests'
view +10 NestedTests.cs
TestNearest
let actual = s:remove_path(g:test#last_command)
Expect actual == 'dotnet xunit -nologo -method Namespace.Parent.NestedTests.TestAsync'
view +18 NestedTests.cs
TestNearest
let actual = s:remove_path(g:test#last_command)
Expect actual == 'dotnet xunit -nologo -method Namespace.Parent.NestedTests.Test'
end
it "runs nearest tests when there is fixture in the same file"
view +18 TestsWithFixture.cs
TestNearest
let actual = s:remove_path(g:test#last_command)
Expect actual == 'dotnet xunit -nologo -class Namespace.TestsWithFixture'
view +20 TestsWithFixture.cs
TestNearest
let actual = s:remove_path(g:test#last_command)
Expect actual == 'dotnet xunit -nologo -method Namespace.TestsWithFixture.TestAsync'
view +26 TestsWithFixture.cs
TestNearest
let actual = s:remove_path(g:test#last_command)
Expect actual == 'dotnet xunit -nologo -method Namespace.TestsWithFixture.Test'
end
it "runs current file if nearest test couldn't be found"
view +1 Tests.cs
normal O
TestNearest
let actual = s:remove_path(g:test#last_command)
Expect actual == 'dotnet xunit -nologo -class Namespace.Tests'
end
it "runs current file tests"
view Tests.cs
TestFile
let actual = s:remove_path(g:test#last_command)
Expect actual == 'dotnet xunit -nologo -class Namespace.Tests'
view NestedTests.cs
TestFile
let actual = s:remove_path(g:test#last_command)
Expect actual == 'dotnet xunit -nologo -class Namespace.Parent'
view TestsWithFixture.cs
TestFile
let actual = s:remove_path(g:test#last_command)
Expect actual == 'dotnet xunit -nologo -class Namespace.TestsWithFixture'
end
it "runs test suites"
view Tests.cs
TestSuite
let actual = s:remove_path(g:test#last_command)
Expect actual == 'dotnet xunit -nologo'
end
end