Calls function `evaluator` before and after a call function `subject`. Output of `evaluator` should change.

    >>> expect = Expector([])
    >>> a = [1, 2, 3]
    >>> expect(a.clear).to(change, lambda: len(a))
    (True, 'expect change: actual from=3 to=0')

    >>> a = [1, 2, 3]
    >>> expect(a.clear).to(change, lambda: len(a), by=-3)
    (True, 'expect change by=-3: actual from=3 to=0')

    >>> a = [1, 2, 3]
    >>> expect(a.clear).to(change, lambda: len(a), frm=3, to=0)
    (True, 'expect change from=3 to=0: actual from=3 to=0')

def change(subject, evaluator, by=_NOT_SET, frm=_NOT_SET, to=_NOT_SET):
    '''
    Calls function `evaluator` before and after a call function `subject`. Output of `evaluator` should change.

    >>> expect = Expector([])
    >>> a = [1, 2, 3]
    >>> expect(a.clear).to(change, lambda: len(a))
    (True, 'expect change: actual from=3 to=0')

    >>> a = [1, 2, 3]
    >>> expect(a.clear).to(change, lambda: len(a), by=-3)
    (True, 'expect change by=-3: actual from=3 to=0')

    >>> a = [1, 2, 3]
    >>> expect(a.clear).to(change, lambda: len(a), frm=3, to=0)
    (True, 'expect change from=3 to=0: actual from=3 to=0')
    '''
    output_before = evaluator()
    subject()
    output_after = evaluator()

    clauses = []
    is_passing = output_before != output_after

    if by != _NOT_SET:
        clauses.append(' by={}'.format(repr(by)))
        delta = output_after - output_before
        if delta != by: is_passing = False

    if frm != _NOT_SET:
        clauses.append(' from={}'.format(repr(frm)))
        if frm != output_before: is_passing = False

    if to != _NOT_SET:
        clauses.append(' to={}'.format(repr(to)))
        if to != output_after: is_passing = False

    return (is_passing, 'expect change{}: actual from={} to={}'.format(
        ''.join(clauses),
        repr(output_before),
        repr(output_after)))