Skip to content

Instantly share code, notes, and snippets.

@tygern
Created February 23, 2016 22:33
Show Gist options
  • Save tygern/ed96e3db374962a743b7 to your computer and use it in GitHub Desktop.
Save tygern/ed96e3db374962a743b7 to your computer and use it in GitHub Desktop.
MessageConsumer spec with Subject
describe('MessageConsumer', function () {
var subject;
beforeEach(function () {
subject = new Rx.Subject();
var provider = new MessageProvider();
spyOn(provider, 'getMessage').and.returnValue(source.asObservable())
consumer = new MessageConsumer(provider);
});
it('gets the messages', function () {
expect(consumer.message).toEqual(undefined);
subject.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