title: How to use the Assert in a block?
body: <p>I had questions about how to use the Assert in a block?</p>
  
  <p>For example:</p>
  
  <pre><code>[someObject postRequestWithBlock:^(BOOL succeeded, NSError *error) {
  
      CFRunLoopRef runLoopRef = CFRunLoopGetCurrent();
      CFRunLoopStop(runLoopRef);
  
      GHAssertTrue(succeeded&amp;&amp;!error, @"faile");
  
  }];
  CFRunLoopRun();
  </code></pre>
  
  <p>It will have to send an asynchronous request .
  After it is completed, I need to Assert whether it is successful.</p>
  
  <p>But it's going to crash!</p>
  
  <p>How i should do?</p>
  
  <p>thx!</p>
  
  <p>PS:
  - (void)testCase
  {
      [self prepare];</p>
  
  <pre><code>__block ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]];
  
  __block typeof (&amp;*self) bself = self;
  
  [request setCompletionBlock:^{
  
      [bself notify:kGHUnitWaitStatusSuccess forSelector:@selector(testCase)];
      GHAssertTrue(YES, @"faile");
  }];
  
  [request setFailedBlock:^{
  
      [bself notify:kGHUnitWaitStatusFailure forSelector:@selector(testCase)];
      GHAssertTrue(NO, @"faile");
  }];
  
  [request startAsynchronous];
  
  [self waitForStatus:kGHUnitWaitStatusCancelled timeout:15.0];
  </code></pre>
  
  <p>}</p>