summaryrefslogtreecommitdiff
path: root/test/System/Utility/H9Clock/DrawSpec.hs
blob: 48d026cb056e5d3d666bb50454b54457c18e6dde (plain)
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
module System.Utility.H9Clock.DrawSpec
        ( spec
        )
where

import           Test.Hspec
import           System.Utility.H9Clock
import           System.Utility.H9Clock.Test.Util

spec :: Spec
spec = do
        let rect = Rectangle (0, 0) (250, 250)
        describe "mkHandPts" $ do
                it "should create hourHand and minHand points" $ do
                        mkHandsPts rect 16 30 `shouldBe` handPts

        describe "Clock color" $ do
                context "of the hour hand" $ do
                        it "should be Dark Blue" $ do
                                getRGB darkBlue `shouldBe` (0, 0, 85)
                context "of the min hand" $ do
                        it "should be Pale Blue" $ do
                                getRGB paleBlue `shouldBe` (0, 0, 187)
                context "of the background" $ do
                        it "should be Pale Blue Green" $ do
                                getRGB paleBlueGreen `shouldBe` (236, 254, 252)

        describe "Clock dots" $ do
                it "should be produced by 23 points" $ do
                        dotsPts 4 4 rect `shouldBe` dPts