ensure

assert given condition is true, or exit


Parameters

ensure condition :block

Attributes

that:stringprints a custom message when ensure fails

Returns

  • :nothing

Examples

copy
num: input "give me a positive number" ensure [num > 0] print "good, the number is positive indeed. let's continue..."

copy
ensure.message: "Wrong calc" -> 0 = 1 + 1 ; >> Assertion | "Wrong calc": [0 = 1 + 1] ; error |

Related