packages feed

mdoc-0.2.0.0: test/Mdoc/Data/ConfigSpec.hs

-- |
--
-- Module      : Mdoc.Data.ConfigSpec
-- Copyright   : (c) 2026 Patrick Brisbin
-- License     : AGPL-3
-- Maintainer  : pbrisbin@gmail.com
-- Stability   : experimental
-- Portability : POSIX
module Mdoc.Data.ConfigSpec
  ( spec
  ) where

import Mdoc.Prelude

import Mdoc.Data.Config
import Mdoc.Data.Described
import Mdoc.Data.Optionality
import Mdoc.Syntax
import Mdoc.Test.Render
import Test.Hspec

spec :: Spec
spec = do
  it "renders with literal examples" $ do
    let config =
          Described
            { item =
                Config
                  { name = Just "git.push"
                  , schema = Simple "boolean"
                  }
            , optionality = Required
            , multiple = False
            , help = Just $ Mdoc [TextLine "Push to git remote"]
            }

    config
      `shouldRender` [ ".It Cm git.push : Ar boolean"
                     , "Push to git remote"
                     ]