18 lines
615 B
Lua
18 lines
615 B
Lua
describe('max', function()
|
|
it('produces an error if its parent errors', function()
|
|
local observable = Rx.Observable.of(''):map(function(x) return x() end)
|
|
expect(observable.subscribe).to.fail()
|
|
expect(observable:max().subscribe).to.fail()
|
|
end)
|
|
|
|
it('produces an error if one of the values produced is a string', function()
|
|
local observable = Rx.Observable.of('string'):max()
|
|
expect(observable.subscribe).to.fail()
|
|
end)
|
|
|
|
it('produces the maximum of all values produced', function()
|
|
local observable = Rx.Observable.fromRange(5):max()
|
|
expect(observable).to.produce(5)
|
|
end)
|
|
end)
|