Skip to content

Commit

Permalink
Add hspec
Browse files Browse the repository at this point in the history
  • Loading branch information
mauriciofierrom committed Jun 4, 2019
1 parent f51319d commit 1e5b534
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
14 changes: 14 additions & 0 deletions dialog-flow.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,17 @@ library
default-language: Haskell2010
ghc-options: -Wall

test-suite dialog-flow-test
type: exitcode-stdio-1.0
main-is: Spec.hs
other-modules:
DialogFlow.MessageSpec
hs-source-dirs:
test
ghc-options: -threaded -rtsopts -with-rtsopts=-N
build-depends:
base ^>=4.12.0.0
, dialog-flow
, hspec
, hspec-discover
default-language: Haskell2010
7 changes: 5 additions & 2 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ let

inherit (nixpkgs) pkgs;

f = { mkDerivation, aeson, base, stdenv, text }:
f = { mkDerivation, aeson, base, hspec, hspec-discover, stdenv
, text
}:
mkDerivation {
pname = "dialog-flow";
version = "0.1.0.0";
src = ./.;
libraryHaskellDepends = [ aeson base text ];
doHaddock = false;
testHaskellDepends = [ base hspec hspec-discover ];
testToolDepends = [ hspec-discover ];
homepage = "https://github.com/mauriciofierrom/dialog-flow";
description = "A Dialog Flow library for Haskell";
license = stdenv.lib.licenses.bsd3;
Expand Down
1 change: 1 addition & 0 deletions src/DialogFlow/Message.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module DialogFlow.Message
, Text(..)
, SimpleResponses(..)
, SimpleResponse(..)
, SpeechText(..)
) where

import Data.Aeson ( FromJSON
Expand Down
10 changes: 10 additions & 0 deletions test/DialogFlow/MessageSpec.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module DialogFlow.MessageSpec where

import Test.Hspec

spec :: Spec
spec = do
describe "Test" $ do
it "should be true" $
1 `shouldBe` 1

1 change: 1 addition & 0 deletions test/Spec.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{-# OPTIONS_GHC -F -pgmF hspec-discover #-}

0 comments on commit 1e5b534

Please sign in to comment.