diff options
| author | Carlos Sosa <gnusosa@gnusosa.net> | 2020-05-01 13:22:05 -0700 |
|---|---|---|
| committer | Carlos Sosa <gnusosa@gnusosa.net> | 2020-05-15 12:37:16 -0700 |
| commit | 723f766abb6ce73d1c0e9e0e1ccc34656737db32 (patch) | |
| tree | 87a7608e38651d9f35014b14b79dad33c9822d2f /test/System/Utility/H9Clock/DrawSpec.hs | |
Initial commit
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 |
