hunk.code_window:       },
         done);
     });
     it('should override `this` in the callback', function (done) {
       function callback(cb) {
         cb(this.value);
       }
       var boundCallback = Observable.bindCallback(callback, {value: 42});
       boundCallback()
         .subscribe(function (x) {
           expect(x).toBe(42);
         }, function () {
           done.fail('should not be called');
         },
         done);
     });
     it('should emit an error when the selector throws', function (done) {
       function callback(cb) {
         cb(42);
       }
  
hunk.labels: keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep
hunk.file_path: spec/observables/bindCallback-spec.js
hunk.type: replace
file: /* globals describe, it, expect, expectObservable, expectSubscriptions, cold, hot */
  var Rx = require('../../dist/cjs/Rx.KitchenSink');
  
  describe('Observable.prototype.isEmpty()', function () {
    it('should return true if source is empty', function () {
      var source = hot('-----|');
      var subs =       '^    !';
      var expected =   '-----(T|)';
  
      expectObservable(source.isEmpty()).toBe(expected, { T: true });
      expectSubscriptions(source.subscriptions).toBe(subs);
    });
  
    it('should return false if source emits element', function () {
      var source = hot('--a--^--b--|');
      var subs =            '^  !';
      var expected =        '---(F|)';
  
      expectObservable(source.isEmpty()).toBe(expected, { F: false });
      expectSubscriptions(source.subscriptions).toBe(subs);
    });
  
    it('should raise error if source raise error', function () {
      var source = hot('--#');
      var subs =       '^ !';
      var expected =   '--#';
  
      expectObservable(source.isEmpty()).toBe(expected);
      expectSubscriptions(source.subscriptions).toBe(subs);
    });
  
    it('should not completes if source never emits', function () {
      var source = cold('-');
      var subs =        '^';
      var expected =    '-';
  
      expectObservable(source.isEmpty()).toBe(expected);
      expectSubscriptions(source.subscriptions).toBe(subs);
    });
  
    it('should return true if source is Observable.empty()', function () {
      var source = cold('|');
      var subs =        '(^!)';
      var expected =    '(T|)';
  
      expectObservable(source.isEmpty()).toBe(expected, { T: true });
      expectSubscriptions(source.subscriptions).toBe(subs);
    });
  
    it('should allow unsubscribing explicitly and early', function () {
      var source = cold('-----------a--b--|');
      var unsub =       '      !           ';
      var subs =        '^     !           ';
      var expected =    '-------           ';
  
      expectObservable(source.isEmpty(), unsub).toBe(expected);
      expectSubscriptions(source.subscriptions).toBe(subs);
    });
  });