 
     func testReplaceRangeRxElements() {
         var a: ObservableArray<String> = ["foo", "bar", "buzz"]
-
-        let exp = expectationWithDescription("event emitted")
-        a.rx_elements().subscribeNext { (elements) -> Void in
-            XCTAssertEqual(["milk", "coffee", "tea", "buzz"], elements)
-            exp.fulfill()
-            }
-            .addDisposableTo(disposeBag)
+        var observed = [[String]]()
+
+        let exp = expectationWithDescription("event emitted")
+        a.rx_elements().subscribeNext { (elements) -> Void in
+            observed.append(elements)
+            if observed.count == 2 {
+                exp.fulfill()
+            }
+        }
+        .addDisposableTo(disposeBag)
 
         a.replaceRange(0...1, with: ["milk", "coffee", "tea"])
 
         waitForExpectationsWithTimeout(1) { (error) in
             XCTAssertNil(error, "\(error)")
         }
+
+        XCTAssertEqual(2, observed.count)
+        XCTAssertEqual(["foo", "bar", "buzz"], observed[0])
+        XCTAssertEqual(["milk", "coffee", "tea", "buzz"], observed[1])
     }
 
     func testReplaceRangeRxEvent() {


    func testPopLastRxElements() {
        var a: ObservableArray<String> = ["foo", "bar", "buzz", "tea"]

        let exp = expectationWithDescription("event emitted")
        a.rx_elements().subscribeNext { (elements) -> Void in
            XCTAssertEqual(["foo", "bar", "buzz"], elements)
            exp.fulfill()
            }
            .addDisposableTo(disposeBag)

        a.popLast()

        waitForExpectationsWithTimeout(1) { (error) in
            XCTAssertNil(error, "\(error)")
        }
    }

    func testPopLastRxEvent() {

            XCTAssertTrue(event.deletedIndices.isEmpty)
            XCTAssertTrue(event.updatedIndices.isEmpty)
            exp.fulfill()
        }
        .addDisposableTo(disposeBag)

        a.appendContentsOf(["buzz", "sugar", "tea"].generate())

