implemented month

This commit is contained in:
Jonathan Lamothe
2019-09-02 10:29:32 -04:00
parent 8b88cbff75
commit f0e0d644d2
2 changed files with 29 additions and 0 deletions

View File

@@ -31,6 +31,7 @@ spec = describe "Mtlstats.Format" $ do
leftSpec
rightSpec
centreSpec
monthSpec
padNumSpec :: Spec
padNumSpec = describe "padNum" $ do
@@ -87,3 +88,14 @@ centreSpec = describe "centre" $ do
context "overflow" $
it "should truncate the text" $
centre 2 "foo" `shouldBe` "fo"
monthSpec :: Spec
monthSpec = describe "month" $ do
context "January" $
it "should return \"JAN\"" $
month 1 `shouldBe` "JAN"
context "invalid" $
it "should return an empty string" $
month 0 `shouldBe` ""