Skip to content

Commit 93af289

Browse files
committed
Improved test
1 parent 87d11d4 commit 93af289

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Tests/SimpleAppTest.fs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,17 +183,17 @@ let ``08 - Validators`` () =
183183

184184
[<Test>]
185185
let ``09 tryParser Directory Info`` () =
186-
testRootCommand "--directory .." {
186+
testRootCommand "--directory \"c:/fake\"" {
187187
description "Custom parser for directory info"
188188
inputs (
189-
option<System.IO.DirectoryInfo> "--directory"
189+
option "--directory"
190190
|> desc "A directory path"
191191
|> required
192192
|> tryParse (fun res ->
193193
let path = res.Tokens[0].Value
194-
if path = ".."
195-
then Error "'..' is not a valid directory"
196-
else Ok (System.IO.DirectoryInfo path)
194+
if System.IO.Directory.Exists path
195+
then Ok (System.IO.DirectoryInfo path)
196+
else Error $"'{path}' is not a valid directory."
197197
)
198198
)
199199
setAction (fun dir ->

0 commit comments

Comments
 (0)