Skip to content

Commit

Permalink
Reimplemented Last operation
Browse files Browse the repository at this point in the history
  • Loading branch information
mairbek committed Mar 4, 2013
1 parent 9dca835 commit 451ca91
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/test/groovy/rx/lang/groovy/ObservableTests.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 451ca91

Please sign in to comment.