Created
March 9, 2016 04:37
-
-
Save danpolanco/cf7873b2288b6782d11b to your computer and use it in GitHub Desktop.
I don't understand how to test for Maybe yet.....
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let validScorecard = Align.Scorecard {Align.match = 1, Align.mismatch = -1, Align.gap = 0} | |
let stalemateScorecard = Align.Scorecard {Align.match = 0, Align.mismatch = 0, Align.gap = 0} | |
describe "Align.validateScorecard" $ do | |
context "with a valid scorecard" $ do | |
it "returns Just the scoredcard" $ do | |
Align.validateScorecard validScorecard `shouldBe` Just validScorecard | |
context "with a scorecard that would lead to a stalemate" $ do | |
it "returns Nothing" $ do | |
Align.validateScorecard stalemateScorecard `shouldBe` (Nothing :: Maybe Align.Scorecard) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I saw this in #hspec on Freenode.
The above seems fine. What's the problem?