1
1
mirror of https://github.com/github/semantic.git synced 2024-11-25 21:43:07 +03:00

Express this a bit more elegantly

This commit is contained in:
Timothy Clem 2018-09-26 16:55:34 -05:00
parent caf23dcf39
commit 2d1a8cc7e7

View File

@ -16,9 +16,7 @@ spec = parallel $ do
output `shouldBe` "{\"trees\":[{\"error\":{\"path\":\"methods.rb\",\"language\":\"Unknown\",\"message\":\"NoLanguageForBlob \\\"methods.rb\\\"\"}}]}\n" output `shouldBe` "{\"trees\":[{\"error\":{\"path\":\"methods.rb\",\"language\":\"Unknown\",\"message\":\"NoLanguageForBlob \\\"methods.rb\\\"\"}}]}\n"
it "throws if given an unknown language for sexpression output" $ do it "throws if given an unknown language for sexpression output" $ do
runTask (runParse SExpressionTermRenderer [methodsBlob { blobLanguage = Unknown }]) `shouldThrow` (\ code -> case code of runTask (runParse SExpressionTermRenderer [methodsBlob { blobLanguage = Unknown }]) `shouldThrow` (== ExitFailure 1)
ExitFailure 1 -> True
_ -> False)
it "renders with the specified renderer" $ do it "renders with the specified renderer" $ do
output <- fmap runBuilder . runTask $ runParse SExpressionTermRenderer [methodsBlob] output <- fmap runBuilder . runTask $ runParse SExpressionTermRenderer [methodsBlob]