Browse Source

Add error test to Observable.changes;

bjorn 10 years ago
parent
commit
8e88057368
1 changed files with 6 additions and 0 deletions
  1. 6 0
      tests/changes.lua

+ 6 - 0
tests/changes.lua

@@ -1,4 +1,10 @@
 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()
     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()