File: ClassSpec.hs

package info (click to toggle)
haskell-persistent 2.14.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,120 kB
  • sloc: haskell: 12,767; makefile: 3
file content (15 lines) | stat: -rw-r--r-- 506 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module Database.Persist.ClassSpec where

import Database.Persist.Class
import Data.Time
import Database.Persist.Types
import Test.Hspec

spec :: Spec
spec = describe "Class" $ do
    describe "PersistField" $ do
        describe "UTCTime" $ do
            it "fromPersistValue with format" $
                fromPersistValue (PersistText "2018-02-27 10:49:42.123")
                    `shouldBe`
                        Right (UTCTime (fromGregorian 2018 02 27) (timeOfDayToTime (TimeOfDay 10 49 42.123)))