
7 changed files with 78 additions and 13 deletions
@ -0,0 +1,21 @@ |
|||
module Site.MetadataSpec (spec) where |
|||
|
|||
import Data.Aeson |
|||
import qualified Data.ByteString.Lazy.UTF8 as B |
|||
import Site.Metadata |
|||
import Test.Hspec |
|||
|
|||
spec :: Spec |
|||
spec = do |
|||
describe "PostMetadata" do |
|||
it "deserializes from YAML" do |
|||
let yaml = |
|||
"content-templates: post \n\ |
|||
\templates: default, skeleton \n\ |
|||
\title: \"App-Config-App in Action\" \n\ |
|||
\author: \"Logan McGrath\" \n\ |
|||
\date: 2012-11-20T07:00:00 CST \n\ |
|||
\comments: false \n\ |
|||
\published: true \n\ |
|||
\tags: AngularJS, Perforce, SCM, Sinatra, Configuration Management" |
|||
return () -- TODO |
@ -1,9 +1,22 @@ |
|||
module Site.UtilSpec (spec) where |
|||
|
|||
import Site.Util |
|||
import Test.Hspec |
|||
|
|||
spec :: Spec |
|||
spec = do |
|||
describe "Hello" do |
|||
it "prints World" do |
|||
putStrLn "Hello World" |
|||
describe "stripSuffix" do |
|||
let suffix = "index.html" |
|||
context "the suffix exists" do |
|||
let input = "this/path/to/index.html" |
|||
it "strips the suffix" do |
|||
stripSuffix suffix input `shouldBe` "this/path/to/" |
|||
context "the suffix does not exist" do |
|||
let input = "this/path/to/something-else.html" |
|||
it "returns the original string" do |
|||
stripSuffix suffix input `shouldBe` input |
|||
|
|||
describe "loadAbsRoot" do |
|||
it "creats a URL prefix with the CNAME file contents" do |
|||
root <- loadAbsRoot |
|||
root `shouldBe` "https://www.thisfieldwas.green" |
|||
|
Loading…
Reference in new issue