Created
February 23, 2016 22:33
-
-
Save tygern/ed96e3db374962a743b7 to your computer and use it in GitHub Desktop.
MessageConsumer spec with 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 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