Last active
February 24, 2016 08:19
-
-
Save tygern/b0810a622ac4b5f9a942 to your computer and use it in GitHub Desktop.
MessageConsumer spec without Subject
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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