intro-spec Pub   Share

Mocking an ordering system:

0 $mock:: order.product (product? ?= "Email", user? ?= "John")
   . (order={items:["Email","Login"],status:"Success"})

Mocking an email server that can create inboxes for users:

0 $mock:: mailServer.create (what? ?= "Email", user)
   $ifc:: (user == "John@") . (payload={status:"Fail"})
   $ifc:: (user != "John@") . (payload={status:"Success"})

Actual implementation of the order flow:

$when:: order.product (product == "Email", user)
   mailServer.create (what="Email"="Email", user)
   . (order={items:["Email","Login"],status:payload[="status"]})


Was this useful?    

By: Razie | 2019-05-04 .. 2019-05-05 | Tags: spec , dsl


Viewed 464 times ( | History | Print ) this page.

You need to log in to post a comment!