diff --git a/tests/all.lua b/tests/all.lua index fc648b5..2263d7e 100644 --- a/tests/all.lua +++ b/tests/all.lua @@ -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}}) diff --git a/tests/map.lua b/tests/map.lua index 092e59c..1f0b7dc 100644 --- a/tests/map.lua +++ b/tests/map.lua @@ -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)