Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (18 sloc) 640 Bytes
module Distribution.Client.SandboxSpec (main, spec) where
import Test.Hspec
import Distribution.Client.Sandbox
import Control.Applicative
import System.FilePath (getSearchPath)
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "withSandboxBinDirOnSearchPath" $ do
it "temporarily adds $SANDBOX_DIR/bin to $PATH" $ do
withSandboxBinDirOnSearchPath "foo" $ do
r <- getSearchPath
r `shouldSatisfy` elem "foo/bin"
it "restores the original PATH after executing the action" $ do
r <- getSearchPath
withSandboxBinDirOnSearchPath "foo" (pure ())
getSearchPath `shouldReturn` r
Something went wrong with that request. Please try again.