'use strict';

var assert = require('assert');
var Response = require('../');

var res = new Response(200, {
  'Foo-Bar': 'baz-Bosh',
  'bar-foo': 'bish-Bosh'
}, 'foo bar baz');
assert(res.statusCode = 200);
assert(res.headers['foo-bar'] === 'baz-Bosh');
assert(res.headers['bar-foo'] === 'bish-Bosh');
assert(res.body === 'foo bar baz');
assert(res.getBody() === 'foo bar baz');

res = new Response(404, {
  'Foo-Bar': 'baz-Bosh'
}, 'Could not find page');
assert(res.statusCode = 404);
assert(res.headers['foo-bar'] === 'baz-Bosh');
assert(res.body === 'Could not find page');
var errored = false;
try {
  res.getBody();
} catch (ex) {
  assert(ex.statusCode === 404);
  assert(ex.headers['foo-bar'] === 'baz-Bosh');
  assert(res.body === 'Could not find page');
  errored = true;
}
if (!errored) {
  throw new Error('res.getBody() should throw an error when the status code is 404');
}
console.log('tests passed');

@@ -160,35 +160,57 @@
 %7D, 'foo bar baz'
+, 'http://example.com'
 );%0A
-
 assert(res.statu
@@ -350,24 +350,66 @@
  bar baz');%0A
+assert(res.url === 'http://example.com');%0A
 assert(res.g
@@ -512,16 +512,38 @@
 nd page'
+, 'http://example.com'
 );%0Aasser
@@ -654,24 +654,66 @@
 ind page');%0A
+assert(res.url === 'http://example.com');%0A
 var errored 
@@ -845,27 +845,26 @@
 );%0A  assert(
-res
+ex
 .body === 'C
@@ -885,16 +885,59 @@
 page');%0A
+  assert(ex.url === 'http://example.com');%0A
   errore

Update tests for `res.url` and `err.url`