'Patch utils.read_file to return few fake JS files.'

@pytest.fixture(autouse=True)
def patch_read_file(self, monkeypatch):

    def _read_file(path, binary=False):
        'Faked    utils.read_file.'
        assert (not binary)
        for (filename, content) in self.js_files:
            if (path == os.path.join('javascript', filename)):
                return content
        raise OSError('File    not    found    {}!'.format(path))
    monkeypatch.setattr('qutebrowser.utils.utils.read_file', _read_file)
