diff --git a/test/main.hs b/test/main.hs
--- a/test/main.hs
+++ b/test/main.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE CPP #-}
 import Test.HUnit hiding (Test)
 import Test.Hspec.Monadic
 import Test.Hspec.HUnit ()
@@ -15,7 +16,13 @@
 parseHtml_ = either error id . parseHtml
 
 main :: IO ()
-main = hspecX $ do
+main =
+#if MIN_VERSION_hspec(1,2,0)
+  hspec
+#else
+  hspecX
+#endif
+   $ do
     describe "CSS selector parsing" $ do
         it "elements" $ parseQuery_ "strong" @?= [[DeepChildren [ByTagName "strong"]]]
         it "child elements" $ parseQuery_ "strong > i" @?= [[DeepChildren [ByTagName "strong"], DirectChildren [ByTagName "i"]]]
diff --git a/yesod-test.cabal b/yesod-test.cabal
--- a/yesod-test.cabal
+++ b/yesod-test.cabal
@@ -1,5 +1,5 @@
 name:               yesod-test
-version:            0.2.0.6
+version:            0.2.1
 license:            MIT
 license-file:       LICENSE
 author:             Nubis <nubis@woobiz.com.ar>
@@ -29,7 +29,7 @@
                    , network                   >= 2.2      && < 2.4
                    , http-types                >= 0.6      && < 0.7
                    , HUnit                     >= 1.2      && < 1.3
-                   , hspec                     >= 1.1      && < 1.2
+                   , hspec                     >= 1.1      && < 1.3
                    , bytestring                >= 0.9
                    , case-insensitive          >= 0.2
                    , text
