diff --git a/src/test/groovy/rx/lang/groovy/ObservableTests.groovy b/src/test/groovy/rx/lang/groovy/ObservableTests.groovy index 1683f12..b949132 100644 --- a/src/test/groovy/rx/lang/groovy/ObservableTests.groovy +++ b/src/test/groovy/rx/lang/groovy/ObservableTests.groovy @@ -61,8 +61,12 @@ def class ObservableTests { @Test public void testLast() { - new TestFactory().getObservable().last().subscribe({ result -> a.received(result)}); - verify(a, times(1)).received("hello_1"); + assertEquals("three", Observable.toObservable("one", "two", "three").last()) + } + + @Test + public void testLastWithPredicate() { + assertEquals("two", Observable.toObservable("one", "two", "three").last({ x -> x.length() == 3})) } @Test