Skip to content

Commit 1bcb343

Browse files
committed
test: add MDX case with old configuration
1 parent 3ef55b6 commit 1bcb343

File tree

4 files changed

+182
-81
lines changed

4 files changed

+182
-81
lines changed

testdata/features/comments.feature

Lines changed: 90 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,96 @@
11
Feature: Comments
22

3-
Scenario: MDX
4-
When I test comments for ".mdx"
5-
Then the output should contain exactly:
6-
"""
7-
test.mdx:15:19:vale.Redundancy:'ACT test' is redundant
8-
test.mdx:19:19:vale.Redundancy:'ACT test' is redundant
9-
test.mdx:25:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
10-
test.mdx:77:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
11-
test.mdx:87:16:demo.Raw:Link "[must not use `.html`](../index.html)" must use the .md file extension.
12-
"""
3+
Scenario: MDX
4+
When I test comments for "test.mdx"
5+
Then the output should contain exactly:
6+
"""
7+
test.mdx:15:19:vale.Redundancy:'ACT test' is redundant
8+
test.mdx:19:19:vale.Redundancy:'ACT test' is redundant
9+
test.mdx:25:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
10+
test.mdx:77:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
11+
test.mdx:87:16:demo.Raw:Link "[must not use `.html`](../index.html)" must use the .md file extension.
12+
"""
1313

14-
Scenario: Markdown
15-
When I test comments for ".md"
16-
Then the output should contain exactly:
17-
"""
18-
test.md:23:19:vale.Redundancy:'ACT test' is redundant
19-
test.md:33:19:vale.Redundancy:'ACT test' is redundant
20-
test.md:37:19:vale.Redundancy:'ACT test' is redundant
21-
test.md:43:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
22-
test.md:95:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
23-
test.md:105:16:demo.Raw:Link "[must not use `.html`](../index.html)" must use the .md file extension.
24-
test.md:109:48:demo.Ending-Preposition:Don't end a sentence with 'for.'
25-
test.md:111:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
26-
test.md:121:19:vale.Redundancy:'ACT test' is redundant
27-
test.md:127:19:vale.Redundancy:'ACT test' is redundant
28-
test.md:127:48:demo.Ending-Preposition:Don't end a sentence with 'for.'
29-
test.md:129:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
30-
test.md:133:48:demo.Ending-Preposition:Don't end a sentence with 'for.'
31-
test.md:135:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
32-
test.md:145:19:vale.Redundancy:'ACT test' is redundant
33-
test.md:151:19:vale.Redundancy:'ACT test' is redundant
34-
test.md:151:48:demo.Ending-Preposition:Don't end a sentence with 'for.'
35-
test.md:153:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
36-
test.md:157:19:vale.Redundancy:'ACT test' is redundant
37-
test.md:163:48:demo.Ending-Preposition:Don't end a sentence with 'for.'
38-
test.md:165:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
39-
test.md:169:19:vale.Redundancy:'ACT test' is redundant
40-
test.md:169:48:demo.Ending-Preposition:Don't end a sentence with 'for.'
41-
test.md:171:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
42-
"""
14+
Scenario: MDX with comment configuration
15+
When I test comments for "test2.mdx"
16+
Then the output should contain exactly:
17+
"""
18+
test2.mdx:15:19:vale.Redundancy:'ACT test' is redundant
19+
test2.mdx:19:19:vale.Redundancy:'ACT test' is redundant
20+
test2.mdx:25:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
21+
test2.mdx:77:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
22+
test2.mdx:87:16:demo.Raw:Link "[must not use `.html`](../index.html)" must use the .md file extension.
23+
"""
4324

44-
Scenario: reStructuredText
45-
When I test comments for ".rst"
46-
Then the output should contain exactly:
47-
"""
48-
test.rst:15:19:vale.Redundancy:'ACT test' is redundant
49-
test.rst:19:19:vale.Redundancy:'ACT test' is redundant
50-
test.rst:25:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
51-
test.rst:41:48:demo.Ending-Preposition:Don't end a sentence with 'for.'
52-
test.rst:43:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
53-
test.rst:53:19:vale.Redundancy:'ACT test' is redundant
54-
test.rst:59:19:vale.Redundancy:'ACT test' is redundant
55-
test.rst:59:48:demo.Ending-Preposition:Don't end a sentence with 'for.'
56-
test.rst:61:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
57-
test.rst:65:48:demo.Ending-Preposition:Don't end a sentence with 'for.'
58-
test.rst:67:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
59-
test.rst:77:19:vale.Redundancy:'ACT test' is redundant
60-
test.rst:83:19:vale.Redundancy:'ACT test' is redundant
61-
test.rst:83:48:demo.Ending-Preposition:Don't end a sentence with 'for.'
62-
test.rst:85:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
63-
test.rst:89:19:vale.Redundancy:'ACT test' is redundant
64-
test.rst:95:48:demo.Ending-Preposition:Don't end a sentence with 'for.'
65-
test.rst:97:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
66-
test.rst:101:19:vale.Redundancy:'ACT test' is redundant
67-
test.rst:101:48:demo.Ending-Preposition:Don't end a sentence with 'for.'
68-
test.rst:103:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
69-
"""
25+
Scenario: Markdown
26+
When I test comments for "test.md"
27+
Then the output should contain exactly:
28+
"""
29+
test.md:23:19:vale.Redundancy:'ACT test' is redundant
30+
test.md:33:19:vale.Redundancy:'ACT test' is redundant
31+
test.md:37:19:vale.Redundancy:'ACT test' is redundant
32+
test.md:43:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
33+
test.md:95:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
34+
test.md:105:16:demo.Raw:Link "[must not use `.html`](../index.html)" must use the .md file extension.
35+
test.md:109:48:demo.Ending-Preposition:Don't end a sentence with 'for.'
36+
test.md:111:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
37+
test.md:121:19:vale.Redundancy:'ACT test' is redundant
38+
test.md:127:19:vale.Redundancy:'ACT test' is redundant
39+
test.md:127:48:demo.Ending-Preposition:Don't end a sentence with 'for.'
40+
test.md:129:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
41+
test.md:133:48:demo.Ending-Preposition:Don't end a sentence with 'for.'
42+
test.md:135:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
43+
test.md:145:19:vale.Redundancy:'ACT test' is redundant
44+
test.md:151:19:vale.Redundancy:'ACT test' is redundant
45+
test.md:151:48:demo.Ending-Preposition:Don't end a sentence with 'for.'
46+
test.md:153:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
47+
test.md:157:19:vale.Redundancy:'ACT test' is redundant
48+
test.md:163:48:demo.Ending-Preposition:Don't end a sentence with 'for.'
49+
test.md:165:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
50+
test.md:169:19:vale.Redundancy:'ACT test' is redundant
51+
test.md:169:48:demo.Ending-Preposition:Don't end a sentence with 'for.'
52+
test.md:171:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
53+
"""
7054

71-
Scenario: AsciiDoc
72-
When I test comments for ".adoc"
73-
Then the output should contain exactly:
74-
"""
75-
test.adoc:15:19:vale.Redundancy:'ACT test' is redundant
76-
test.adoc:19:19:vale.Redundancy:'ACT test' is redundant
77-
test.adoc:25:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
78-
"""
55+
Scenario: reStructuredText
56+
When I test comments for "test.rst"
57+
Then the output should contain exactly:
58+
"""
59+
test.rst:15:19:vale.Redundancy:'ACT test' is redundant
60+
test.rst:19:19:vale.Redundancy:'ACT test' is redundant
61+
test.rst:25:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
62+
test.rst:41:48:demo.Ending-Preposition:Don't end a sentence with 'for.'
63+
test.rst:43:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
64+
test.rst:53:19:vale.Redundancy:'ACT test' is redundant
65+
test.rst:59:19:vale.Redundancy:'ACT test' is redundant
66+
test.rst:59:48:demo.Ending-Preposition:Don't end a sentence with 'for.'
67+
test.rst:61:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
68+
test.rst:65:48:demo.Ending-Preposition:Don't end a sentence with 'for.'
69+
test.rst:67:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
70+
test.rst:77:19:vale.Redundancy:'ACT test' is redundant
71+
test.rst:83:19:vale.Redundancy:'ACT test' is redundant
72+
test.rst:83:48:demo.Ending-Preposition:Don't end a sentence with 'for.'
73+
test.rst:85:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
74+
test.rst:89:19:vale.Redundancy:'ACT test' is redundant
75+
test.rst:95:48:demo.Ending-Preposition:Don't end a sentence with 'for.'
76+
test.rst:97:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
77+
test.rst:101:19:vale.Redundancy:'ACT test' is redundant
78+
test.rst:101:48:demo.Ending-Preposition:Don't end a sentence with 'for.'
79+
test.rst:103:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
80+
"""
7981

80-
Scenario: Org Mode
81-
When I test comments for ".org"
82-
Then the output should contain exactly:
83-
"""
84-
test.org:17:21:vale.Redundancy:'ACT test' is redundant
85-
"""
82+
Scenario: AsciiDoc
83+
When I test comments for "test.adoc"
84+
Then the output should contain exactly:
85+
"""
86+
test.adoc:15:19:vale.Redundancy:'ACT test' is redundant
87+
test.adoc:19:19:vale.Redundancy:'ACT test' is redundant
88+
test.adoc:25:20:demo.Ending-Preposition:Don't end a sentence with 'of.'
89+
"""
90+
91+
Scenario: Org Mode
92+
When I test comments for "test.org"
93+
Then the output should contain exactly:
94+
"""
95+
test.org:17:21:vale.Redundancy:'ACT test' is redundant
96+
"""

testdata/features/steps.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@
9696
step %(I run `#{exe} .`)
9797
end
9898

99-
When(/^I test comments for "(.*)"$/) do |ext|
99+
When(/^I test comments for "(.*)"$/) do |file|
100100
step %(I cd to "../../fixtures/comments")
101-
step %(I run `#{cmd} test#{ext}`)
101+
step %(I run `#{cmd} #{file}`)
102102
end
103103

104104
When(/^I test patterns for "(.*)"$/) do |file|

testdata/fixtures/comments/.vale.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ demo.CheckLinks = NO
99
demo.Spellcheck = NO
1010
demo.ZeroOccurrence = NO
1111
demo.SentenceCaseAny = NO
12+
13+
[test2.mdx]
14+
CommentDelimiters = {/*, */}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{/* vale off */}
2+
3+
This is some text ACT test
4+
5+
This is some text ACT test
6+
7+
{/* vale on */}
8+
9+
{/* vale vale.Redundancy = NO */}
10+
11+
This is some text ACT test
12+
13+
{/* vale vale.Redundancy = YES */}
14+
15+
This is some text ACT test
16+
17+
{/* vale demo.Ending-Preposition = NO */}
18+
19+
This is some text ACT test. This is a sentence for.
20+
21+
This is a sentance of.
22+
23+
{/* vale demo.Ending-Preposition = YES */}
24+
25+
This is a sentance of.
26+
27+
1. Consider the following `deployment.yaml` file.
28+
29+
```yaml
30+
apiVersion: v1
31+
kind: Service
32+
metadata:
33+
name: my-nginx-svc
34+
labels:
35+
app: nginx
36+
spec:
37+
type: LoadBalancer
38+
ports:
39+
- port: 80
40+
selector:
41+
app: nginx
42+
---
43+
apiVersion: apps/v1
44+
kind: Deployment
45+
metadata:
46+
name: my-nginx
47+
labels:
48+
app: nginx
49+
spec:
50+
replicas: 3
51+
selector:
52+
matchLabels:
53+
app: nginx
54+
template:
55+
metadata:
56+
labels:
57+
app: nginx
58+
spec:
59+
containers:
60+
- name: nginx
61+
image: nginx:1.7.9
62+
ports:
63+
- containerPort: 80
64+
```
65+
66+
2. few other steps.
67+
{/* vale off */}
68+
1. This is a sentance of.
69+
```bash
70+
SSH should not typically be used within containers.
71+
Ensure that non-SSH services are not using port 22.
72+
```
73+
{/* vale on */}
74+
75+
something else.
76+
77+
This is a sentance of.
78+
79+
- Unordered list example.
80+
{/* vale off */}
81+
- This is a sentance of.
82+
{/* vale on */}
83+
- one more item.
84+
85+
{/* vale demo.Raw = NO */}
86+
87+
Internal Links [must not use `.html`](../index.html)

0 commit comments

Comments
 (0)