Skip to content

Instantly share code, notes, and snippets.

@tygern
Last active February 24, 2016 08:19
Show Gist options
  • Select an option

  • Save tygern/b0810a622ac4b5f9a942 to your computer and use it in GitHub Desktop.

Select an option

Save tygern/b0810a622ac4b5f9a942 to your computer and use it in GitHub Desktop.
MessageConsumer spec without Subject
describe('MessageConsumer', function () {
var observer;
beforeEach(function () {
var source = Rx.Observable.create(function (o) {
observer = o;
});
var provider = new MessageProvider();
spyOn(provider, 'getMessage').and.returnValue(source)
consumer = new MessageConsumer(provider);
});
it('gets the messages', function () {
expect(consumer.message).toEqual(undefined);
observer.onNext('hello there');
expect(consumer.message).toEqual('hello there');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment