You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Power Assert shows each value of variables and method calls in the expression. It is useful for testing, providing which value wasn’t correct when the condition is not satisfied.
Expressions must be put in one line. Expressions with folded long lines produce nothing report, e.g.:
assert do
# reported
func(foo: 0123456789, bar: "abcdefg")
end
assert do
# won't be reported
func(foo: 0123456789,
bar: "abcdefg")
end
Expressions must have one or more method call. Expressions with no method call produce nothing report, e.g.:
val = falseassertdo# reportedval==trueendassertdo# won't be reportedvalend
Returned values from accessor methods, method missing, or “super” produce nothing report, e.g:
classFooattr_accessor:valendfoo = Foo.newfoo.val = falseassertdo# reported (only the value of "foo" and the literal "carview.php?tsp=true")foo.val==trueendassertdo# won't be reportedfoo.valend
Expressions should not have conditional branches. Expressions with such conditional codes may produce nothing report, e.g.:
condition = trueexpected = falseactual = trueassertdo# this will fail but nothing reportedcondition?expected==actual:expected==actualend