var fs      = require('fs');
var app = require('../examples/afterSend');
var expect = require('unexpected')
    .clone()
    .installPlugin(require('unexpected-express'))
    .addAssertion('to yield response', function (expect, subject, value) {
        return expect(app, 'to yield exchange', {
            request: subject,
            response: value
        });
    });

function cleanupLog(done){
  fs.exists('body.log', function (exists) {
    if(exists){
      fs.unlink('body.log',done);
    } else {
      done();
    }
  });
}

describe('Using the after() method', function() {

  before(cleanupLog);

  it('should intercept the generated .html and respond with the same .html', function() {
    return expect('/README.md', 'to yield response', 200);
  });

  it('verify log file exist', function() {
    return expect(fs.existsSync('body.log'), 'to be true');
  });

  after(cleanupLog);
});

@@ -800,32 +800,34 @@
 unction() %7B%0A    
+  
 return expect(fs
@@ -829,45 +829,107 @@
 ct(f
-s.existsSync('body.log'), 'to be true
+unction (cb) %7B%0A          fs.open('body.log', 'r', cb);%0A      %7D, 'to call the callback without error
 ');%0A

Replace fs.existsSync in afterSend test.