Преглед изворни кода

Add error test to Observable.changes;

bjorn пре 10 година
родитељ
комит
8e88057368
1 измењених фајлова са 6 додато и 0 уклоњено
  1. 6 0
      tests/changes.lua

+ 6 - 0
tests/changes.lua

@@ -1,4 +1,10 @@
 describe('changes', function()
 describe('changes', function()
+  it('produces an error if its parent errors', function()
+    local observable = Rx.Observable.fromValue(''):map(function(x) return x() end)
+    expect(observable.subscribe).to.fail()
+    expect(observable:changes().subscribe).to.fail()
+  end)
+
   describe('with the default comparator', function()
   describe('with the default comparator', function()
     it('produces a value if it is the first value or different from the previous', function()
     it('produces a value if it is the first value or different from the previous', function()
       local observable = Rx.Observable.fromTable({1, 1, 3, 1, 4, 5, 5, 5}, ipairs):changes()
       local observable = Rx.Observable.fromTable({1, 1, 3, 1, 4, 5, 5, 5}, ipairs):changes()