title: Condition in expect block
body: <p>I just noticed that Spock does not assert the conditions if I add an <code>if</code> clause in the expect block as in</p>
  
  <pre><code>def myTest() {
    given:
      a = true
  
    expect:
      if ( a ) {
        1 == 2
      }
      else {
        1 == 1
      }      
  }
  </code></pre>
  
  <p>The above <strong>test will pass</strong> since the <strong>conditions are not checked.</strong> Or the condition checking does not get forwarded pass the if statement.</p>
  
  <p>The workaround to this is to add <code>assert</code> statements inside the if block, i.e. assert 1 == 2.</p>
  
  <p>What I'm interested is, is why the functionality is like this? Is there some other way to workaround this? I'm assuming this has something to do with Groovy if statement functionality, but I don't know the language details well enough. Most probably the if statement does not return anything for the Spock's expect block to work with. </p>