Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yongjhih committed May 26, 2016
1 parent 4712e40 commit 47456b6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions rxbolts-tasks/src/test/java/rx/bolts/TaskObservableTests.java
Expand Up @@ -28,6 +28,8 @@
//import static mocker.Mocker.mocker;
//import mocker.Mocker;
import static rx.assertions.RxAssertions.assertThat;
import org.assertj.core.api.Assertions;
import rx.Observable;

public class TaskObservableTests {

Expand All @@ -44,6 +46,14 @@ public void just() {
.completes();
}

@Test
public void justDefer() {
assertThat(TaskObservable.defer(() -> Task.<String>forResult(null)))
.withoutErrors()
.emitsNothing()
.completes();
}

@Test
public void justNullable() {
assertThat(TaskObservable.justNullable(Task.<String>forResult(null)))
Expand Down Expand Up @@ -79,5 +89,9 @@ public void deferNonNull() {
.failsWithThrowable(NullPointerException.class);
}

@Test
public void forTask() {
Assertions.assertThat(TaskObservable.forTask(Observable.empty()).getResult()).isNull();
}

}

0 comments on commit 47456b6

Please sign in to comment.