Skip to content

Commit

Permalink
Improve error tests;
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornbytes committed Jun 24, 2017
1 parent 679f3b5 commit 611166c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions tests/all.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ describe('all', function()
expect(#onError).to.equal(1)
end)

it('produces an error if the parent errors', function()
local _, onError = observableSpy(Rx.Observable.throw():all(function(x) return x end))
expect(#onError).to.equal(1)
end)

it('produces true if all elements satisfy the predicate', function()
local observable = Rx.Observable.fromRange(5):all(function(x) return x < 10 end)
expect(observable).to.produce({{true}})
Expand Down
2 changes: 1 addition & 1 deletion tests/map.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe('map', function()
it('produces an error if its parent errors', function()
local observable = Rx.Observable.of(''):map(function(x) return x() end)
local observable = Rx.Observable.throw():map(function(x) return x end)
expect(observable.subscribe).to.fail()
expect(observable:map().subscribe).to.fail()
end)
Expand Down

0 comments on commit 611166c

Please sign in to comment.