@@ -93,7 +93,7 @@ main = do
9393 withSystemTempDirectory "initCache" $ \initCache -> do
9494 -- Setup the ob init cache
9595 void . shellyOb verbosity $ chdir (fromString initCache) $ do
96− run_ "ob" ["init", "--symlink", obeliskImpl]
96+ run_ "ob" ["init"]
9797 run_ "git" ["init"]
9898 hspec $ parallel $ do
9999 let shelly_ = void . shellyOb verbosity
@@ -101,8 +101,9 @@ main = do
101101 inTmp :: (Shelly.FilePath -> Sh a) -> IO ()
102102 inTmp f = shelly_ . withSystemTempDirectory "test" $ (chdir <*> f) . fromString
103103
104− obInitFromCache dir = run_ "cp" ["-a", fromString $ initCache <> "/.", toTextIgnore dir]
105− inTmpObInit f = inTmp $ \dir -> obInitFromCache dir *> f
104+ inTmpObInit f = inTmp $ \dir -> do
105+ run_ "cp" ["-a", fromString $ initCache <> "/.", toTextIgnore dir]
106+ f dir
106107
107108 assertRevEQ a b = liftIO . assertEqual "" "" =<< diff a b
108109 assertRevNE a b = liftIO . assertBool "" . (/= "") =<< diff a b
@@ -136,16 +137,15 @@ main = do
136137 void $ errExit False $ run "ob" ["init", "--symlink", "/dev/null"]
137138 ls tmp >>= liftIO . assertEqual "" []
138139
139− it "produces a valid route config" $ inTmp $ \tmp -> do
140− run_ "ob" ["init"]
140+ it "produces a valid route config" $ inTmpObInit $ \tmp -> do
141141 liftIO $ withCurrentDirectory (T.unpack $ toTextIgnore tmp) $ getConfigRoute `shouldNotReturn` Nothing
142142
143143 -- These tests fail with "Could not find module 'Obelisk.Generated.Static'"
144144 -- when not run by 'nix-build --attr selftest'
145145 describe "ob run" $ parallel $ do
146− it "works in root directory" $ inTmpObInit $ do
146+ it "works in root directory" $ inTmpObInit $ \_ -> do
147147 testObRunInDir Nothing httpManager
148− it "works in sub directory" $ inTmpObInit $ do
148+ it "works in sub directory" $ inTmpObInit $ \_ -> do
149149 testObRunInDir (Just "frontend") httpManager
150150
151151 describe "obelisk project" $ parallel $ do
@@ -157,34 +157,32 @@ main = do
157157
158158 describe "blank initialized project" $ parallel $ do
159159
160− it "can build ghc.backend" $ inTmpObInit $ do
160+ it "can build ghc.backend" $ inTmpObInit $ \_ -> do
161161 run "nix-build" ["--no-out-link", "-A", "ghc.backend"]
162− it "can build ghcjs.frontend" $ inTmpObInit $ do
162+ it "can build ghcjs.frontend" $ inTmpObInit $ \_ -> do
163163 run "nix-build" ["--no-out-link", "-A", "ghcjs.frontend"]
164164
165165 if os == "darwin"
166− then it "can build ios" $ inTmpObInit $ run "nix-build" ["--no-out-link", "-A", "ios.frontend" ]
167− else it "can build android" $ inTmpObInit $ run "nix-build" ["--no-out-link", "-A", "android.frontend"]
166+ then it "can build ios" $ inTmpObInit $ \_ -> run "nix-build" ["--no-out-link", "-A", "ios.frontend" ]
167+ else it "can build android" $ inTmpObInit $ \_ -> run "nix-build" ["--no-out-link", "-A", "android.frontend"]
168168
169169 forM_ ["ghc", "ghcjs"] $ \compiler -> do
170170 let
171171 shell = "shells." <> compiler
172172 inShell cmd' = run "nix-shell" ["-A", fromString shell, "--run", cmd']
173− it ("can enter " <> shell) $ inTmpObInit $ inShell "exit"
174− it ("can build in " <> shell) $ inTmpObInit $ inShell $ "cabal new-build --" <> fromString compiler <> " all"
173+ it ("can enter " <> shell) $ inTmpObInit $ \_ -> inShell "exit"
174+ it ("can build in " <> shell) $ inTmpObInit $ \_ -> inShell $ "cabal new-build --" <> fromString compiler <> " all"
175175
176− it "can build reflex project" $ inTmpObInit $ do
176+ it "can build reflex project" $ inTmpObInit $ \_ -> do
177177 run "nix-build" []
178178
179− it "has idempotent thunk update" $ inTmpObInit $ do
179+ it "has idempotent thunk update" $ inTmpObInit $ \_ -> do
180180 u <- update
181181 uu <- update
182182 assertRevEQ u uu
183183
184184 describe "ob thunk pack/unpack" $ parallel $ do
185− it "has thunk pack and unpack inverses" $ inTmp $ \_ -> do
186− _ <- run "ob" ["init"]
187− _ <- run "git" ["init"]
185+ it "has thunk pack and unpack inverses" $ inTmpObInit $ \_ -> do
188186
189187 e <- commitAll
190188 eu <- unpack
@@ -214,9 +212,7 @@ main = do
214212
215213 testThunkPack $ fromText repo
216214
217− it "aborts thunk pack when there are uncommitted files" $ inTmp $ \dir -> do
218− _ <- run "ob" ["init"]
219− _ <- run "git" ["init"]
215+ it "aborts thunk pack when there are uncommitted files" $ inTmpObInit $ \dir -> do
220216 void $ unpack
221217 testThunkPack (dir </> thunk)
222218