17 lines
657 B
Lua
17 lines
657 B
Lua
describe('unpack', 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:unpack()).to.produce.error()
|
|
end)
|
|
|
|
it('fails if the observable produces an element that is not a table', function()
|
|
expect(Rx.Observable.of(3):unpack()).to.produce.error()
|
|
end)
|
|
|
|
it('produces all elements in the tables produced as multiple values', function()
|
|
local observable = Rx.Observable.fromTable({{1, 2, 3}, {4, 5, 6}}, ipairs):unpack()
|
|
expect(observable).to.produce({{1, 2, 3}, {4, 5, 6}})
|
|
end)
|
|
end)
|