local Rx = require 'Rx'

local Disposable = Rx.Disposable

--------------------------------------------------------------------------------

local MockDisposable = {

    Disposable,

    _scheduler = false,

    _disposes = false,

    __init = function(self, scheduler)

        self._scheduler = scheduler
        self._disposes = { scheduler:clock() }

        return function() end

    end,

    dispose = function(self)

        self._disposes[#self._disposes + 1] = self._scheduler:clock()

        return self:Rx_Disposable_dispose()

    end,

}

--------------------------------------------------------------------------------

return Rx.Class('Rx.MockDisposable', MockDisposable)
