-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathExample.hs
35 lines (29 loc) · 1.03 KB
/
Example.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
-- | Example used by golden testing of XML reports
--
-- The path name and line numbers of this file are part of the golden report
-- being tested with. So if this file changes, they will need to be regenerated.
-- In fact, this sentence was added to retain them across a formatting change.
module Example (spec) where
import Control.Exception
import Prelude
import Test.Hspec
spec :: Spec
spec = do
describe "Some section" $ do
it "has an expectation" $ do
True `shouldBe` True
it "has a failure" $ do
True `shouldBe` False
context "A grouped context" $ do
it "happens in a group" $ do
True `shouldBe` True
it "also happens in a group" $ do
True `shouldBe` True
it "gets skipped" $ do
pendingWith "some reason"
it "throws a colourful exception" $ do
throwIO ColourfulException :: IO ()
data ColourfulException = ColourfulException
deriving stock (Show)
instance Exception ColourfulException where
displayException _ = "\x1b[32mColour\x1b[31mful\x1b[0mException"