message: test(fromEventPattern): simplify test fixture using mocks
diff: @@ -18,46 +18,28 @@ describe('Observable.fromEventPattern', () => {
  .concat(Observable.never())
  .subscribe(h);
  }
  - const e1 = Observable.fromEventPattern(addHandler, () => void 0);
  + const e1 = Observable.fromEventPattern(addHandler);
  const expected = '-----x-x---';
  expectObservable(e1).toBe(expected, {x: 'ev'});
  });
  it('should call addHandler on subscription', () => {
  - let addHandlerCalledWith;
  - const addHandler = (h: any) => {
  - addHandlerCalledWith = h;
  - };
  -
  - const removeHandler = () => {
  - //noop
  - };
  -
  - Observable.fromEventPattern(addHandler, removeHandler)
  - .subscribe(() => {
  - //noop
  - });
  + const addHandler = sinon.spy();
  + Observable.fromEventPattern(addHandler, noop).subscribe(noop);
  - expect(addHandlerCalledWith).to.be.a('function');
  + const call = addHandler.getCall(0);
  + expect(addHandler).calledOnce;
  + expect(call.args[0]).to.be.a('function');
  });
  it('should call removeHandler on unsubscription', () => {
  - let removeHandlerCalledWith;
  - const addHandler = () => {
  - //noop
  - };
  - const removeHandler = (h: any) => {
  - removeHandlerCalledWith = h;
  - };
  -
  - const subscription = Observable.fromEventPattern(addHandler, removeHandler)
  - .subscribe(() => {
  - //noop
  - });
  + const removeHandler = sinon.spy();
  - subscription.unsubscribe();
  + Observable.fromEventPattern(noop, removeHandler).subscribe(noop).unsubscribe();
  - expect(removeHandlerCalledWith).to.be.a('function');
  + const call = removeHandler.getCall(0);
  + expect(removeHandler).calledOnce;
  + expect(call.args[0]).to.be.a('function');
  });
  it('should work without optional removeHandler', () => {
  @@ -77,16 +59,15 @@ describe('Observable.fromEventPattern', () => {
  expect(call).calledWith(sinon.match.any, expected);
  });
  - it('should send errors in addHandler down the error path', () => {
  + it('should send errors in addHandler down the error path', (done: MochaDone) => {
  Observable.fromEventPattern((h: any) => {
  throw 'bad';
  - }, () => {
  - //noop
  - }).subscribe(() => {
  - //noop
  - }, (err: any) => {
  + }, noop).subscribe(
  + () => done(new Error('should not be called')),
  + (err: any) => {
  expect(err).to.equal('bad');
  - });
  + done();
  + }, () => done(new Error('should not be called')));
  });
  it('should accept a selector that maps outgoing values', (done: MochaDone) => {
  