diff options
author | James Crayne <jim.crayne@gmail.com> | 2016-04-26 00:42:20 -0400 |
---|---|---|
committer | James Crayne <jim.crayne@gmail.com> | 2016-04-26 06:04:05 -0400 |
commit | d8fe87bbc40c15b88439cfe78349d1792e078901 (patch) | |
tree | 5e3d45ff67f4917a5e470f4697dc1b22b558111b | |
parent | ee87a66174faa29803351cb4fa63b69cfb456d16 (diff) |
Fix tests: --homedir is relative to --chroot
Also, increase time stamp resolution to the second.
-rw-r--r-- | testkiki/testkiki.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/testkiki/testkiki.hs b/testkiki/testkiki.hs index 452d298..19c54dc 100644 --- a/testkiki/testkiki.hs +++ b/testkiki/testkiki.hs | |||
@@ -35,7 +35,7 @@ main = do | |||
35 | cwd <- getCurrentDirectory | 35 | cwd <- getCurrentDirectory |
36 | let chomp x = takeWhile (/='\n') x | 36 | let chomp x = takeWhile (/='\n') x |
37 | date <- maybe (return "") | 37 | date <- maybe (return "") |
38 | (\x -> chomp <$> readProcess x ["+%Y-%m-%d-%H%M"] "") =<< findExecutable "date" | 38 | (\x -> chomp <$> readProcess x ["+%Y-%m-%d-%H%M%S"] "") =<< findExecutable "date" |
39 | 39 | ||
40 | let tdir = cwd </> "TESTS" </> date | 40 | let tdir = cwd </> "TESTS" </> date |
41 | 41 | ||
@@ -77,13 +77,13 @@ doTests tkConfig = hspec $ do | |||
77 | cfg = appendpaths tkConfig "0" | 77 | cfg = appendpaths tkConfig "0" |
78 | (isInfixOf "New packet" <$> kiki ["init"]) `shouldReturn` True | 78 | (isInfixOf "New packet" <$> kiki ["init"]) `shouldReturn` True |
79 | 79 | ||
80 | it "creates parent directories with --gnupghome" $ do | 80 | it "creates parent directories with --homedir" $ do |
81 | let home = chroot cfg </> "home" </> "tester" | 81 | let home = "home" </> "tester" |
82 | cfg = appendpaths tkConfig "1" | 82 | cfg = appendpaths tkConfig "1" |
83 | kiki = kiki'Env'And'HomeArg cfg | 83 | kiki = kiki'Env'And'HomeArg cfg |
84 | { gnupghome = home </> ".gnupg" } | 84 | { gnupghome = home </> ".gnupg" } |
85 | output <- kiki ["init"] | 85 | output <- kiki ["init"] |
86 | b <- doesDirectoryExist home | 86 | b <- doesDirectoryExist (chroot cfg </> home) |
87 | -- isInfixOf "New packet" output | 87 | -- isInfixOf "New packet" output |
88 | b `shouldBe` True | 88 | b `shouldBe` True |
89 | 89 | ||