title: Executing all assertions in the same Spock test, even if one of them fails
body: <p>I am trying to verify two different outputs in the context of a single Spock method that runs multiple test cases of the form <code>when-then-where</code>. For this reason I use two assertions at the <code>then</code> block, as can be seen in the following example:</p>
  
  <pre><code>import spock.lang.*
  
  @Unroll
  class ExampleSpec extends Specification {
  
       def "Authentication test with empty credentials"() {
           when:
           def reportedErrorMessage, reportedErrorCode
           (reportedErrorMessage, reportedErrorCode) = userAuthentication(name, password)
  
           then:
           reportedErrorMessage == expectedErrorMessage
           reportedErrorCode    == expectedErrorCode
  
           where:
           name | password || expectedErrorMessage | expectedErrorCode
           ' '  | null     || 'Empty credentials!' | 10003
           ' '  | ' '      || 'Empty credentials!' | 10003
       }
  }
  </code></pre>
  
  <p>The code is an example where the design requirement is that if <code>name</code> and <code>password</code> are <code>' '</code> or <code>null</code>, then I should always expect exactly the same <code>expectedErrorMessage = 'Empty credentials!'</code> and <code>expectedErrorCode = 10003</code>. If for some reason (presumably because of bugs in the source code) I get <code>expectedErrorMessage = Empty!</code> (or anything else other than <code>'Empty credentials!'</code>) and <code>expectedErrorCode = 10001</code> (or anything else other than <code>1003</code>), this would not satisfy the above requirement.</p>
  
  <p>The problem is that if both assertions fail <em>in the same test</em>, I get a failing message only for the first assertion (here for <code>reportedErrorMessage</code>). Is it possible to get informed for all failed assertions in the same test?</p>
  
  <p>Here is a piece of code that demonstrates the same problem without other external code dependencies. I understand that in this particular case it is not a good practice to bundle two very different tests together, but I think it still demonstrates the problem.</p>
  
  <pre><code>import spock.lang.*
  
  @Unroll
  class ExampleSpec extends Specification {
  
      def "minimum of #a and #b is #c and maximum of #a and #b is #d"() {
          expect:
          Math.min(a, b) == c
          Math.max(a, b) == d
  
          where:
          a | b || c | d
          3 | 7 || 3 | 7
          5 | 4 || 5 | 4  // &lt;--- both c and d fail here
          9 | 9 || 9 | 9
      }
  }
  </code></pre>