13 lines
497 B
Lua
13 lines
497 B
Lua
describe('pack', function()
|
|
it('produces an error if its parent errors', function()
|
|
local observable = Rx.Observable.of(''):map(function(x) return x() end)
|
|
expect(observable).to.produce.error()
|
|
expect(observable:pack()).to.produce.error()
|
|
end)
|
|
|
|
it('wraps elements of the source in tables', function()
|
|
local observable = Rx.Observable.fromTable({4, 5, 6}, ipairs, true):pack()
|
|
expect(observable).to.produce({{{4, 1, n = 2}}, {{5, 2, n = 2}}, {{6, 3, n = 2}}})
|
|
end)
|
|
end)
|