class Rx::MockObserver
Attributes
messages[R]
Public Class Methods
new(scheduler)
click to toggle source
# File lib/rx/testing/mock_observer.rb, line 14 def initialize(scheduler) raise 'scheduler cannot be nil' unless scheduler @scheduler = scheduler @messages = [] end
Public Instance Methods
on_completed()
click to toggle source
# File lib/rx/testing/mock_observer.rb, line 29 def on_completed messages.push(Recorded.new(@scheduler.clock, Notification.create_on_completed)) end
on_error(error)
click to toggle source
# File lib/rx/testing/mock_observer.rb, line 25 def on_error(error) messages.push(Recorded.new(@scheduler.clock, Notification.create_on_error(error))) end
on_next(value)
click to toggle source
# File lib/rx/testing/mock_observer.rb, line 21 def on_next(value) messages.push(Recorded.new(@scheduler.clock, Notification.create_on_next(value))) end