public function assertResponseCodeIs($code) {
        $this->requireResponse();

        try {
            Assertion::same(
                $actual = $this->response->getStatusCode(),
                $expected = $this->validateResponseCode($code),
                sprintf('Expected response code %d, got %d.', $expected, $actual)
            );
        } catch (AssertionFailure $e) {
            throw new AssertionFailedException($e->getMessage());
        }
    }