diff options
| author | Eugen Wissner <belka@caraus.de> | 2019-07-10 05:57:35 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2019-07-10 05:57:35 +0200 |
| commit | eb40810f25a2ab29e24c64f1e3c82b3b590460c8 (patch) | |
| tree | 7baaf32a12cf69f864f69718e20357534a71bf5f /tests/Test/KitchenSinkSpec.hs | |
| parent | 61879fb12437302d6b14e0e0297e3a8742d91f8b (diff) | |
| download | graphql-eb40810f25a2ab29e24c64f1e3c82b3b590460c8.tar.gz | |
Replace tasty and HUnit with Hspec
Diffstat (limited to 'tests/Test/KitchenSinkSpec.hs')
| -rw-r--r-- | tests/Test/KitchenSinkSpec.hs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/Test/KitchenSinkSpec.hs b/tests/Test/KitchenSinkSpec.hs new file mode 100644 index 0000000..99a00f7 --- /dev/null +++ b/tests/Test/KitchenSinkSpec.hs @@ -0,0 +1,29 @@ +module Test.KitchenSinkSpec + ( spec + ) where + +import qualified Data.Text.IO as Text.IO +import qualified Language.GraphQL.Encoder as Encoder +import qualified Language.GraphQL.Parser as Parser +import Paths_graphql (getDataFileName) +import Test.Hspec ( Spec + , describe + , it + ) +import Test.Hspec.Expectations ( expectationFailure + , shouldBe + ) +import Text.Megaparsec ( errorBundlePretty + , parse + ) + +spec :: Spec +spec = describe "Kitchen Sink" $ + it "prints the query" $ do + dataFileName <- getDataFileName "tests/data/kitchen-sink.min.graphql" + expected <- Text.IO.readFile dataFileName + + either + (expectationFailure . errorBundlePretty) + (flip shouldBe expected . Encoder.document) + $ parse Parser.document dataFileName expected |
