diff --git a/example/Spec.hs b/example/Spec.hs
new file mode 100644
--- /dev/null
+++ b/example/Spec.hs
@@ -0,0 +1,1 @@
+{-# OPTIONS_GHC -F -pgmF hspec-discover #-}
diff --git a/hspec-discover.cabal b/hspec-discover.cabal
--- a/hspec-discover.cabal
+++ b/hspec-discover.cabal
@@ -1,5 +1,5 @@
 name:             hspec-discover
-version:          0.0.4
+version:          0.0.5
 license:          MIT
 license-file:     LICENSE
 copyright:        (c) 2012 Simon Hengel
@@ -55,3 +55,30 @@
     , directory
     , hspec
     , hspec-shouldbe
+
+test-suite example
+  type:
+      exitcode-stdio-1.0
+  ghc-options:
+      -Wall -Werror
+  hs-source-dirs:
+      example
+  main-is:
+      Spec.hs
+  build-depends:
+      base >= 4 && <= 5
+    , hspec-shouldbe
+    , hspec-discover
+
+test-suite integration-test-empty
+  type:
+      exitcode-stdio-1.0
+  ghc-options:
+      -Wall -Werror
+  hs-source-dirs:
+      integration-test/empty
+  main-is:
+      Spec.hs
+  build-depends:
+      base >= 4 && <= 5
+    , hspec-discover
diff --git a/integration-test/empty/Spec.hs b/integration-test/empty/Spec.hs
new file mode 100644
--- /dev/null
+++ b/integration-test/empty/Spec.hs
@@ -0,0 +1,1 @@
+{-# OPTIONS_GHC -F -pgmF hspec-discover #-}
diff --git a/src/Run.hs b/src/Run.hs
--- a/src/Run.hs
+++ b/src/Run.hs
@@ -65,7 +65,9 @@
 
 -- | Convert a list of specs to code.
 formatSpecs :: [SpecNode] -> ShowS
-formatSpecs = sequenceS . map formatSpec
+formatSpecs xs
+  | null xs   = "return ()"
+  | otherwise = sequenceS (map formatSpec xs)
 
 -- | Convert a spec to code.
 formatSpec :: SpecNode -> ShowS
@@ -83,7 +85,9 @@
 --
 -- Hierarchical modules are mapped to nested specs.
 formatSpecsNested :: [SpecNode] -> ShowS
-formatSpecsNested = sequenceS . map formatSpecNested
+formatSpecsNested xs
+  | null xs   = "return ()"
+  | otherwise = sequenceS (map formatSpecNested xs)
 
 -- | Convert a spec to code.
 --
