diff options
author | Simon Hengel <sol@typeful.net> | 2014-02-22 21:55:35 +0100 |
---|---|---|
committer | Simon Hengel <sol@typeful.net> | 2014-02-22 21:55:35 +0100 |
commit | dfc006ad2b8f5cb27570ac02c77aa63c5c027cd9 (patch) | |
tree | 1290969491d22db33cd4554cc857704b55ff7f87 /test | |
parent | fc7fd1875d31dbfd37eaa058177e534b4fc6bc25 (diff) |
Turn a source code comment into specs
Diffstat (limited to 'test')
-rw-r--r-- | test/Haddock/ParserSpec.hs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/test/Haddock/ParserSpec.hs b/test/Haddock/ParserSpec.hs index ac57b644..db843ccf 100644 --- a/test/Haddock/ParserSpec.hs +++ b/test/Haddock/ParserSpec.hs @@ -360,23 +360,26 @@ spec = before initStaticOpts $ do ] `shouldParseTo` DocCodeBlock "foo\nbar\nbaz" - it "ignores single leading spaces" $ do + it "strips one leading space from each line of the block" $ do unlines [ "> foo" - , "> bar" + , "> bar" , "> baz" - ] `shouldParseTo` DocCodeBlock "foo\nbar\nbaz" + ] `shouldParseTo` DocCodeBlock "foo\n bar\nbaz" + it "ignores empty lines when stripping spaces" $ do unlines [ "> foo" , ">" , "> bar" ] `shouldParseTo` DocCodeBlock "foo\n\nbar" - unlines [ - ">foo" - , "> bar" - ] `shouldParseTo` DocCodeBlock "foo\n bar" + context "when any non-empty line does not start with a space" $ do + it "does not strip any spaces" $ do + unlines [ + ">foo" + , "> bar" + ] `shouldParseTo` DocCodeBlock "foo\n bar" it "ignores nested markup" $ do unlines [ |