implemented moving to top and bottom rungs
This commit is contained in:
@@ -33,6 +33,8 @@ spec :: Spec
|
||||
spec = describe "Actions" $ do
|
||||
moveUpSpec
|
||||
moveDownSpec
|
||||
topRungSpec
|
||||
bottomRungSpec
|
||||
selRungSpec
|
||||
beadLeftSpec
|
||||
beadRightSpec
|
||||
@@ -69,6 +71,18 @@ moveDownSpec = describe "moveDown" $ mapM_
|
||||
elsewhere = initialState & rungNum .~ 8
|
||||
movedDown = initialState & rungNum .~ 1
|
||||
|
||||
topRungSpec :: Spec
|
||||
topRungSpec = describe "topRung" $ let
|
||||
state = initialState & rungNum .~ 5
|
||||
in it ("should be " ++ show initialState) $
|
||||
topRung state `shouldBe` initialState
|
||||
|
||||
bottomRungSpec :: Spec
|
||||
bottomRungSpec = describe "bottomRung" $ let
|
||||
expected = initialState & rungNum .~ 9
|
||||
in it ("should be " ++ show expected) $
|
||||
bottomRung initialState `shouldBe` expected
|
||||
|
||||
selRungSpec :: Spec
|
||||
selRungSpec = describe "selRung" $ mapM_
|
||||
( \(desc, rung, expected) -> context desc $
|
||||
|
||||
Reference in New Issue
Block a user