Skip to content

Commit 56fcb70

Browse files
9999yearssol
andauthored
Rename tests
Co-authored-by: Simon Hengel <[email protected]>
1 parent 189aa42 commit 56fcb70

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

test/System/Process/TypedSpec.hs

+17-13
Original file line numberDiff line numberDiff line change
@@ -171,28 +171,28 @@ spec = do
171171
let expected = "Raw command: podman exec --detach-keys \"\" ctx bash"
172172
in show (proc "podman" ["exec", "--detach-keys", "", "ctx", "bash"]) `shouldBe` expected
173173

174-
describe "ProcessConfig" $ do
175-
it "Show shell-escapes arguments" $ do
174+
describe "Show ProcessConfig" $ do
175+
it "shell-escapes arguments" $ do
176176
let processConfig = proc "echo" ["a", "", "\"b\"", "'c'", "\\d"]
177177
-- I promise this escaping behavior is correct; paste it into GHCi
178178
-- `putStrLn` and then paste it into `sh` to verify.
179179
show processConfig `shouldBe`
180180
"Raw command: echo a \"\" \"\\\"b\\\"\" \"'c'\" \"\\\\d\""
181181

182-
it "Show displays working directory" $ do
182+
it "displays working directory" $ do
183183
let processConfig = setWorkingDir "puppy/doggy" $ proc "true" []
184184
show processConfig `shouldBe`
185185
"Raw command: true\n"
186186
++ "Run from: puppy/doggy"
187187

188-
it "Show displays environment (1 variable)" $ do
188+
it "displays environment (1 variable)" $ do
189189
let processConfig = setEnv [("PUPPY", "DOGGY")] $ proc "true" []
190190
show processConfig `shouldBe`
191191
"Raw command: true\n"
192192
++ "Environment:\n"
193193
++ "PUPPY=DOGGY"
194194

195-
it "Show displays environment (multiple variables)" $ do
195+
it "displays environment (multiple variables)" $ do
196196
let processConfig =
197197
setEnv [ ("PUPPY", "DOGGY")
198198
, ("SOUND", "AWOO")
@@ -206,7 +206,7 @@ spec = do
206206
++ "SOUND=AWOO\n"
207207
++ "HOWLING=RIGHT_NOW"
208208

209-
it "Show displays working directory and environment" $ do
209+
it "displays working directory and environment" $ do
210210
let processConfig =
211211
setEnv [ ("PUPPY", "DOGGY")
212212
, ("SOUND", "AWOO")
@@ -221,8 +221,8 @@ spec = do
221221
++ "SOUND=AWOO"
222222

223223

224-
describe "ExitCodeException" $ do
225-
it "Show" $ do
224+
describe "Show ExitCodeException" $ do
225+
it "shows ExitCodeException" $ do
226226
-- Note that the `show` output ends with a newline, so functions
227227
-- like `print` will output an extra blank line at the end of the
228228
-- output.
@@ -243,7 +243,8 @@ spec = do
243243
++ "Standard error:\n"
244244
++ "Uh oh!\n"
245245

246-
it "Show only stdout" $ do
246+
context "without stderr" $ do
247+
it "shows ExitCodeException" $ do
247248
let exitCodeException =
248249
ExitCodeException
249250
{ eceExitCode = ExitFailure 1
@@ -258,7 +259,8 @@ spec = do
258259
++ "Standard output:\n"
259260
++ "No puppies found???\n"
260261

261-
it "Show only stderr" $ do
262+
context "without stdout" $ do
263+
it "shows ExitCodeException" $ do
262264
let exitCodeException =
263265
ExitCodeException
264266
{ eceExitCode = ExitFailure 1
@@ -272,7 +274,7 @@ spec = do
272274
++ "Standard error:\n"
273275
++ "No puppies found???\n"
274276

275-
it "Show does not trim stdout/stderr" $ do
277+
it "does not trim stdout/stderr" $ do
276278
-- This looks weird, and I think it would be better to strip the
277279
-- whitespace from the output.
278280
let exitCodeException =
@@ -292,7 +294,8 @@ spec = do
292294
++ "Standard error:\n"
293295
++ "\t \ndoggy\n \t\n"
294296

295-
it "Show displays weirdly with no newlines in stdout" $ do
297+
context "without newlines in stdout" $ do
298+
it "shows ExitCodeException" $ do
296299
-- Sometimes, commands don't output _any_ newlines!
297300
let exitCodeException =
298301
ExitCodeException
@@ -308,7 +311,8 @@ spec = do
308311
++ "Standard output:\n"
309312
++ "puppy"
310313

311-
it "Show displays weirdly with no newlines in stdout or stderr" $ do
314+
context "without newlines in stdout or stderr" $ do
315+
it "shows ExitCodeException" $ do
312316
-- If the stderr isn't empty and stdout doesn't end with a newline,
313317
-- the blank line between the two sections disappears.
314318
let exitCodeException =

0 commit comments

Comments
 (0)