Skip to content

Commit

Permalink
Update test/Spago/Build.purs
Browse files Browse the repository at this point in the history
  • Loading branch information
f-f authored Nov 1, 2024
1 parent 4f16b32 commit cbb29d2
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions test/Spago/Build.purs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,15 @@ spec = Spec.around withTempDir do
spago [ "init", "--name", "aaa", "--use-solver" ] >>= shouldBeSuccess
spago [ "build" ] >>= shouldBeSuccess

Spec.after (rmRf <<< _.testCwd)
$ Spec.it "exits when purs exits non-ok"
$ \{ spago, fixture } -> do
spago [ "init", "--name", "aaa" ] >>= shouldBeSuccess
spago [ "build", "--purs-args", "--non-existent" ] >>= shouldBeFailureErr (fixture "purs-not-ok.txt")
Spec.it "exits when purs exits non-ok" \{ spago, fixture } -> do
spago [ "init", "--name", "aaa" ] >>= shouldBeSuccess
spago [ "build", "--purs-args", "--non-existent" ] >>=
checkOutputs'
{ stdoutFile: Nothing
, stderrFile: Just (fixture "purs-not-ok.txt")
, result: isLeft
, sanitize: String.trim >>> String.replace (String.Pattern "Usage: purs.bin") (String.Replacement "Usage: purs")
}

Spec.it "passes options to purs" \{ spago } -> do
spago [ "init" ] >>= shouldBeSuccess
Expand Down

0 comments on commit cbb29d2

Please sign in to comment.