Minor refactor

Use `shouldReturn`
This commit is contained in:
Fujimura Daisuke 2014-08-19 12:01:05 +08:00
parent 70e8cbc9c2
commit c6d6f8c71a

View file

@ -24,10 +24,9 @@ spec :: Spec
spec = around withCleanDatabase $ do spec = around withCleanDatabase $ do
describe "useDb" $ do describe "useDb" $ do
it "changes the db" $ do it "changes the db" $ do
db1 <- fakeDB thisDatabase let anotherDBName = "another-mongodb-haskell-test"
db1 `shouldBe` testDBName fakeDB thisDatabase `shouldReturn` testDBName
db2 <- fakeDB $ useDb "another-mongodb-haskell-test" thisDatabase fakeDB (useDb anotherDBName thisDatabase) `shouldReturn` anotherDBName
db2 `shouldBe` "another-mongodb-haskell-test"
describe "insert" $ do describe "insert" $ do
it "inserts a document to the collection and returns its _id" $ do it "inserts a document to the collection and returns its _id" $ do