skipLast.lua 661 B

1234567891011121314151617
  1. describe('skipLast', function()
  2. it('produces an error if its parent errors', function()
  3. expect(Rx.Observable.throw():skipLast(1).subscribe).to.fail()
  4. end)
  5. it('fails if the count is not specified', function()
  6. expect(Rx.Observable.fromRange(3):skipLast().subscribe).to.fail()
  7. end)
  8. it('skips the specified number of values from the end of the source Observable', function()
  9. expect(Rx.Observable.fromRange(5):skipLast(2)).to.produce(1, 2, 3)
  10. end)
  11. it('produces all elements produced by the source if the count is less than or equal to zero', function()
  12. expect(Rx.Observable.fromRange(3):skipLast(-1)).to.produce(1, 2, 3)
  13. end)
  14. end)