lights-story Pub

Stories (aka user stories) are told in terms of input messages and expected messages or values...

On one beautiful summer eve, a guest arrived:

send::  msg home.guest_arrived  (name<-"Jane")

Naturally, the lights must have come on and Jane was greeted:

expect::  lights.on
expect::  (lightIntensity is "bright")

expect::  (greeting is "Greetings, Jane")
expect::  chimes.welcome (name is "Jane")

Let's see if John is greeted - he shouldn't be. Trick: clear the context first...

send::  msg ctx.clear 

send::  msg home.guest_arrived  (name<-"John")

expect::  (greeting not defined)

Play with this: change some values, for instance Jane to Jim and see how things look when there are errors.

Was this useful?    

By: Razie | 2016-06-17 .. 2017-05-09 | Tags: story , dsl , home

Viewed 136 times ( | Print ) this page.

You need to log in to post a comment!

© Copyright DieselApps, 2012-2020, all rights reserved.