1{-# LANGUAGE QuasiQuotes #-}
2module Data.Yaml.IncludeSpec (main, spec) where
5import Data.Either.Compat
8import Data.Yaml (ParseException)
10import Data.Yaml.Include
17 describe "decodeFile" $ do
18 it "supports includes" $ do
19 decodeFile "test/resources/foo.yaml" `shouldReturn` Just [aesonQQ|
22 bar: {one: 1, two: 2},
27 it "supports recursive includes" $ do
28 decodeFile "test/resources/baz.yaml" `shouldReturn` Just [aesonQQ|
32 bar: {one: 1, two: 2},
38 it "aborts on cyclic includes" $ do
39 (decodeFile "test/resources/loop/foo.yaml" :: IO (Maybe Value)) `shouldThrow` anyException
41 describe "decodeFileEither" $ do
42 context "when file does not exist" $ do
43 it "returns Left" $ do
44 (decodeFileEither "./does_not_exist.yaml" :: IO (Either ParseException Value)) >>= (`shouldSatisfy` isLeft)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list