Skip to content

Commit ee8ef8c

Browse files
committed
Update test descriptions to use backticks and single quotes
Wrap test descriptions in single quotes to prevent backtick command execution. Example: ' should succeed' Part of #24
1 parent 90cfe18 commit ee8ef8c

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

test/expects.bats

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,199 +2,199 @@
22

33
# shellcheck disable=SC2016
44

5-
@test "expects 10 to_be 10 should succeed" {
5+
@test '`expects 10 to_be 10` should succeed' {
66
run expects 10 to_be 10
77
[[ $status -eq 0 ]]
88
}
99

10-
@test "expects 42 to_be 10 should fail" {
10+
@test '`expects 42 to_be 10` should fail' {
1111
run expects 42 to_be 10
1212
[[ $status -eq 1 ]]
1313
[[ $output == "FAIL: expected {actual} to_be 10, but {actual} is: 42" ]]
1414
}
1515

16-
@test "expects 10 not to_be 42 should succeed" {
16+
@test '`expects 10 not to_be 42` should succeed' {
1717
run expects 10 not to_be 42
1818
[[ $status -eq 0 ]]
1919
}
2020

21-
@test "expects 10 not to_be 10 should fail" {
21+
@test '`expects 10 not to_be 10` should fail' {
2222
run expects 10 not to_be 10
2323
[[ $status -eq 1 ]]
2424
[[ $output == "FAIL: expected {actual} not to_be 10, but {actual} is: 10" ]]
2525
}
2626

27-
@test "expects 5 to_be_less_than 10 should succeed" {
27+
@test '`expects 5 to_be_less_than 10` should succeed' {
2828
run expects 5 to_be_less_than 10
2929
[[ $status -eq 0 ]]
3030
}
3131

32-
@test "expects 15 to_be_less_than 10 should fail" {
32+
@test '`expects 15 to_be_less_than 10` should fail' {
3333
run expects 15 to_be_less_than 10
3434
[[ $status -eq 1 ]]
3535
[[ $output == "FAIL: expected {actual} to_be_less_than 10, but {actual} is: 15" ]]
3636
}
3737

38-
@test "expects 10 not to_be_less_than 5 should succeed" {
38+
@test '`expects 10 not to_be_less_than 5` should succeed' {
3939
run expects 10 not to_be_less_than 5
4040
[[ $status -eq 0 ]]
4141
}
4242

43-
@test "expects 5 not to_be_less_than 10 should fail" {
43+
@test '`expects 5 not to_be_less_than 10` should fail' {
4444
run expects 5 not to_be_less_than 10
4545
[[ $status -eq 1 ]]
4646
[[ $output == "FAIL: expected {actual} not to_be_less_than 10, but {actual} is: 5" ]]
4747
}
4848

49-
@test "expects 10 to_be_greater_than 5 should succeed" {
49+
@test '`expects 10 to_be_greater_than 5` should succeed' {
5050
run expects 10 to_be_greater_than 5
5151
[[ $status -eq 0 ]]
5252
}
5353

54-
@test "expects 5 to_be_greater_than 10 should fail" {
54+
@test '`expects 5 to_be_greater_than 10` should fail' {
5555
run expects 5 to_be_greater_than 10
5656
[[ $status -eq 1 ]]
5757
[[ $output == "FAIL: expected {actual} to_be_greater_than 10, but {actual} is: 5" ]]
5858
}
5959

60-
@test "expects 5 not to_be_greater_than 10 should succeed" {
60+
@test '`expects 5 not to_be_greater_than 10` should succeed' {
6161
run expects 5 not to_be_greater_than 10
6262
[[ $status -eq 0 ]]
6363
}
6464

65-
@test "expects 10 not to_be_greater_than 5 should fail" {
65+
@test '`expects 10 not to_be_greater_than 5` should fail' {
6666
run expects 10 not to_be_greater_than 5
6767
[[ $status -eq 1 ]]
6868
[[ $output == "FAIL: expected {actual} not to_be_greater_than 5, but {actual} is: 10" ]]
6969
}
7070

71-
@test "expects 10 to_equal 10 should succeed" {
71+
@test '`expects 10 to_equal 10` should succeed' {
7272
run expects 10 to_equal 10
7373
[[ $status -eq 0 ]]
7474
}
7575

76-
@test "expects 10 to_equal 20 should fail" {
76+
@test '`expects 10 to_equal 20` should fail' {
7777
run expects 10 to_equal 20
7878
[[ $status -eq 1 ]]
7979
[[ $output == "FAIL: expected {actual} to_equal 20, but {actual} is: 10" ]]
8080
}
8181

82-
@test "expects 10 not to_equal 20 should succeed" {
82+
@test '`expects 10 not to_equal 20` should succeed' {
8383
run expects 10 not to_equal 20
8484
[[ $status -eq 0 ]]
8585
}
8686

87-
@test "expects 10 not to_equal 10 should fail" {
87+
@test '`expects 10 not to_equal 10` should fail' {
8888
run expects 10 not to_equal 10
8989
[[ $status -eq 1 ]]
9090
[[ $output == "FAIL: expected {actual} not to_equal 10, but {actual} is: 10" ]]
9191
}
9292

93-
@test "expects 'hello world' to_contain 'world' should succeed" {
93+
@test '`expects "hello world" to_contain "world"` should succeed' {
9494
run expects "hello world" to_contain "world"
9595
[[ $status -eq 0 ]]
9696
}
9797

98-
@test "expects 'hello world' to_contain 'moon' should fail" {
98+
@test '`expects "hello world" to_contain "moon"` should fail' {
9999
run expects "hello world" to_contain "moon"
100100
[[ $status -eq 1 ]]
101101
[[ $output == "FAIL: expected {actual} to_contain moon, but {actual} is: hello world" ]]
102102
}
103103

104-
@test "expects 'hello' not to_contain 'xyz' should succeed" {
104+
@test '`expects "hello" not to_contain "xyz"` should succeed' {
105105
run expects "hello" not to_contain "xyz"
106106
[[ $status -eq 0 ]]
107107
}
108108

109-
@test "expects 'hello' not to_contain 'ell' should fail" {
109+
@test '`expects "hello" not to_contain "ell"` should fail' {
110110
run expects "hello" not to_contain "ell"
111111
[[ $status -eq 1 ]]
112112
[[ $output == "FAIL: expected {actual} not to_contain ell, but {actual} is: hello" ]]
113113
}
114114

115-
@test "expects 'hello123' to_match '^[a-z]+[0-9]+$' should succeed" {
115+
@test '`expects "hello123" to_match "^[a-z]+[0-9]+$"` should succeed' {
116116
run expects "hello123" to_match "^[a-z]+[0-9]+$"
117117
[[ $status -eq 0 ]]
118118
}
119119

120-
@test "expects 'hello123' to_match '^[0-9]+$' should fail" {
120+
@test '`expects "hello123" to_match "^[0-9]+$"` should fail' {
121121
run expects "hello123" to_match "^[0-9]+$"
122122
[[ $status -eq 1 ]]
123123
[[ $output == "FAIL: expected {actual} to_match ^[0-9]+$, but {actual} is: hello123" ]]
124124
}
125125

126-
@test "expects 'abc' not to_match '^[0-9]+$' should succeed" {
126+
@test '`expects "abc" not to_match "^[0-9]+$"` should succeed' {
127127
run expects "abc" not to_match "^[0-9]+$"
128128
[[ $status -eq 0 ]]
129129
}
130130

131-
@test "expects '123' not to_match '^[0-9]+$' should fail" {
131+
@test '`expects "123" not to_match "^[0-9]+$"` should fail' {
132132
run expects "123" not to_match "^[0-9]+$"
133133
[[ $status -eq 1 ]]
134134
[[ $output == "FAIL: expected {actual} not to_match ^[0-9]+$, but {actual} is: 123" ]]
135135
}
136136

137-
@test "expects true to_be_true should succeed" {
137+
@test '`expects true to_be_true` should succeed' {
138138
run expects true to_be_true
139139
[[ $status -eq 0 ]]
140140
}
141141

142-
@test "expects false to_be_true should fail" {
142+
@test '`expects false to_be_true` should fail' {
143143
run expects false to_be_true
144144
[[ $status -eq 1 ]]
145145
[[ $output == "FAIL: expected {actual} to_be_true, but {actual} is: false" ]]
146146
}
147147

148-
@test "expects false not to_be_true should succeed" {
148+
@test '`expects false not to_be_true` should succeed' {
149149
run expects false not to_be_true
150150
[[ $status -eq 0 ]]
151151
}
152152

153-
@test "expects true not to_be_true should fail" {
153+
@test '`expects true not to_be_true` should fail' {
154154
run expects true not to_be_true
155155
[[ $status -eq 1 ]]
156156
[[ $output == "FAIL: expected {actual} not to_be_true, but {actual} is: true" ]]
157157
}
158158

159-
@test "expects false to_be_false should succeed" {
159+
@test '`expects false to_be_false` should succeed' {
160160
run expects false to_be_false
161161
[[ $status -eq 0 ]]
162162
}
163163

164-
@test "expects true to_be_false should fail" {
164+
@test '`expects true to_be_false` should fail' {
165165
run expects true to_be_false
166166
[[ $status -eq 1 ]]
167167
[[ $output == "FAIL: expected {actual} to_be_false, but {actual} is: true" ]]
168168
}
169169

170-
@test "expects true not to_be_false should succeed" {
170+
@test '`expects true not to_be_false` should succeed' {
171171
run expects true not to_be_false
172172
[[ $status -eq 0 ]]
173173
}
174174

175-
@test "expects false not to_be_false should fail" {
175+
@test '`expects false not to_be_false` should fail' {
176176
run expects false not to_be_false
177177
[[ $status -eq 1 ]]
178178
[[ $output == "FAIL: expected {actual} not to_be_false, but {actual} is: false" ]]
179179
}
180180

181-
@test "expects 'value' to_be_defined should succeed" {
181+
@test '`expects "value" to_be_defined` should succeed' {
182182
run expects "value" to_be_defined
183183
[[ $status -eq 0 ]]
184184
}
185185

186-
@test "expects '' to_be_defined should fail" {
186+
@test '`expects "" to_be_defined` should fail' {
187187
run expects "" to_be_defined
188188
[[ $status -eq 1 ]]
189189
[[ $output == "FAIL: expected {actual} to_be_defined, but {actual} is empty" ]]
190190
}
191191

192-
@test "expects '' not to_be_defined should succeed" {
192+
@test '`expects "" not to_be_defined` should succeed' {
193193
run expects "" not to_be_defined
194194
[[ $status -eq 0 ]]
195195
}
196196

197-
@test "expects 'value' not to_be_defined should fail" {
197+
@test '`expects "value" not to_be_defined` should fail' {
198198
run expects "value" not to_be_defined
199199
[[ $status -eq 1 ]]
200200
[[ $output == "FAIL: expected {actual} not to_be_defined, but {actual} is: value" ]]

0 commit comments

Comments
 (0)