title: Groovy Power Assert Statement Output
body: <p>I'm using Spock and hate hard asserts for functional tests.  I've written a SoftAssert class and everything works, I just want to make it look more like Groovy's power asserts.</p>
  
  <p>Here is my existing method:</p>
  
  <pre><code>public void verifyEquals(def expected, def actual, String message = '') {
      try {
          assert expected == actual
      } catch (AssertionError e) {
          LOGGER.warn("Verification failed, expected: ${expected.toString()} but got ${actual}.\n ${message}")
          softAssertList.add(new SoftAssert(message, e))
      }
  }
  </code></pre>
  
  <p>I'm just catching the failure, simple enough.  Now what is lacking is the nice output that Groovy does so well.  Instead of the statements I pass into verifyEquals such as: <code>verifyEquals(8, (3 + x) * z)</code> </p>
  
  <pre><code>8 == (3 + x) * z
    |     | |  | |
    |     | 0  | |
    |     3    | 2
    |          6
  false
  </code></pre>
  
  <p>I get <code>expected == actual</code></p>
  
  <pre><code>expected == actual
     |     |    |
     8     |    6
         false
  </code></pre>
  
  <p>This happens because the statement is calculated prior to passing it into the method.  Does anyone know how to keep the test in the format of <code>verifyEquals(8, (3 + x) * z)</code> while passing in the parameters and how to keep the Power Assert error from the original parameters?</p>