Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.8.0
-
None
-
None
Description
Command Chaining cannot be used in conjunction with Power Asserts:
class Driver { static EnterInto enter(text) { new EnterInto(text: text) } } class EnterInto { def text def into(field) { println "enter $text into $field" text } } import static Driver.* assert "1234" == enter("1234").into("field1") def value = enter "5678" into "field2" assert "5678" == value //assert "9012" == enter "9012" into "field3"
if the last assert is uncommented then a compilation error occurs.
You can work around this problem by assigning the value to a temporary value and using the power asset on that value, but this means that you loose the breakdown from the power assert showing why the assert failed:
assert "1234" == enter("2345").into("field1") | | | | | 2345 | EnterInto@882dfc false