diff --git a/LICENSE b/LICENSE
new file mode 100644
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2015 Simon Hengel <sol@typeful.net>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/Setup.lhs b/Setup.lhs
new file mode 100644
--- /dev/null
+++ b/Setup.lhs
@@ -0,0 +1,3 @@
+#!/usr/bin/env runhaskell
+> import Distribution.Simple
+> main = defaultMain
diff --git a/mockery.cabal b/mockery.cabal
new file mode 100644
--- /dev/null
+++ b/mockery.cabal
@@ -0,0 +1,46 @@
+-- This file has been generated from package.yaml by hpack.
+--
+-- see: https://github.com/sol/hpack
+
+name:           mockery
+version:        0.0.0
+synopsis:       Support functions for automated testing
+description:    Support functions for automated testing
+category:       Testing
+bug-reports:    https://github.com/sol/mockery/issues
+author:         Simon Hengel <sol@typeful.net>
+maintainer:     Simon Hengel <sol@typeful.net>
+copyright:      (c) 2015 Simon Hengel
+license:        MIT
+license-file:   LICENSE
+build-type:     Simple
+cabal-version:  >= 1.10
+
+source-repository head
+  type: git
+  location: https://github.com/sol/mockery
+
+library
+  hs-source-dirs: src
+  exposed-modules:
+      Test.Mockery.Directory
+  build-depends:
+      base == 4.*
+    , temporary
+    , directory
+  ghc-options: -Wall
+  default-language: Haskell2010
+
+test-suite spec
+  type: exitcode-stdio-1.0
+  hs-source-dirs: test
+  main-is: Spec.hs
+  build-depends:
+      base == 4.*
+    , temporary
+    , directory
+
+    , mockery
+    , hspec == 2.*
+  ghc-options: -Wall
+  default-language: Haskell2010
diff --git a/src/Test/Mockery/Directory.hs b/src/Test/Mockery/Directory.hs
new file mode 100644
--- /dev/null
+++ b/src/Test/Mockery/Directory.hs
@@ -0,0 +1,30 @@
+module Test.Mockery.Directory (
+  inTempDirectory
+, inTempDirectoryNamed
+) where
+
+import           Control.Exception
+import           System.Directory
+import           System.IO.Temp (withSystemTempDirectory)
+
+-- |
+-- Run given action with the current working directory set to a temporary
+-- directory.
+--
+-- The directory is created before the action is run.  After the action has
+-- completed the directory is removed and the current working directory is
+-- restored to its original value.
+inTempDirectory :: IO a -> IO a
+inTempDirectory action = withSystemTempDirectory "hspec" $ \path -> do
+  bracket getCurrentDirectory setCurrentDirectory $ \_ -> do
+    setCurrentDirectory path
+    action
+
+-- |
+-- Similar to `inTempDirectory`, but the temporary directory will have the
+-- specified name.
+inTempDirectoryNamed :: FilePath -> IO a -> IO a
+inTempDirectoryNamed name action = inTempDirectory $ do
+  createDirectory name
+  setCurrentDirectory name
+  action
diff --git a/test/Spec.hs b/test/Spec.hs
new file mode 100644
--- /dev/null
+++ b/test/Spec.hs
@@ -0,0 +1,1 @@
+{-# OPTIONS_GHC -F -pgmF hspec-discover #-}
