diff options
Diffstat (limited to 'test/System/Utility/H9Clock/DrawSpec.hs')
| -rw-r--r-- | test/System/Utility/H9Clock/DrawSpec.hs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/System/Utility/H9Clock/DrawSpec.hs b/test/System/Utility/H9Clock/DrawSpec.hs new file mode 100644 index 0000000..48d026c --- /dev/null +++ b/test/System/Utility/H9Clock/DrawSpec.hs @@ -0,0 +1,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 |
