• Stars
    star
    117
  • Rank 301,828 (Top 6 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created about 9 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

[DEPRECATED] AssertJ assertions for RxJava Observables

Deprecated

Assertj-rx is now deprecated. In-order to test observabales, please use the TestSubscriber - more information on this can be found here. Whilst the current version still remains usable, there will no longer be any new development taking place.

AssertJ RxJava

AssertJ assertions for RxJava Observables.

This library extends AssertJ core with the aim of providing elegant assertions to test RxJava Observables. The current version of this library only provides assertions aimed at testing "cold" Observables. You will need to transform your Observable into a BlockingObservable before performing any assertion.

Feedback and contributions are very welcome.

##Examples

  • Assert that completes successfully without emitting any error:
assertThat(observable.toBlocking()).completes();
  • Assert that completes after emitting a single value "hello":
assertThat(observable.toBlocking())
    .completes()
    .emitsSingleValue("hello");
  • Assert that completes without emitting any value:
assertThat(observable.toBlocking())
    .completes()
    .emitsNoValues();
  • Assert that emits an error:
assertThat(observable.toBlocking()).fails();
  • Assert that emits an error of type IllegalArgumentException
assertThat(observable.toBlocking())
    .failsWithError(IllegalArgumentException.class);
  • Assert that completes after emitting three values that are exactly "a", "b" and "c":
assertThat(observable.toBlocking())
    .completes()
    .listOfValuesEmitted()
    .containsExactly("a", "b", "c");
  • Assert that fails after emitting "a" and "b":
assertThat(observable.toBlocking())
    .fails()
    .listOfValuesEmitted()
    .containsExactly("a", "b");
  • Assert that completes after emitting 10 values
assertThat(observable.toBlocking())
   .completes()
   .valuesCountIs(10);

Installation

Artifacts are on Maven central.

Gradle:

testCompile 'uk.co.ribot.assertj-rx:assertj-rx:0.1.0'

Maven:

<dependency>
  <groupId>uk.co.ribot.assertj-rx</groupId>
  <artifactId>assertj-rx</artifactId>
  <version>0.1.0</version>
  <scope>test</scope>
</dependency>

Alternatively, you can download the jar from the releases section.

License

Copyright (C) 2015 Ribot Ltd.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

More Repositories

1

android-guidelines

Architecture and code guidelines we use at ribot when developing for Android
5,046
star
2

ribot-app-android

The ribot studio app for the Android Platform
Java
1,240
star
3

easy-adapter

[DEPRECATED] Easy Adapters library for Android
Java
421
star
4

dokku-slack

A plugin for Dokku that notifies Slack of deployments.
Shell
73
star
5

SublimeAndroidImport

A Sublime Text 2/3 plugin which automatically adds imports from the Android SDK.
Python
30
star
6

sketch-user-flow-docs

This plugin lets you link images in a document with an extenal image file and update them all at once.
Objective-C
20
star
7

ribot-api

An API to access information at ribot
JavaScript
12
star
8

pig

Pig aims to be the bridge in the middle of your native mobile UI and a some shared JavaScript business logic.
Java
11
star
9

sketch-toggle-locked-layers

JavaScript
10
star
10

SublimeAndroidSnippets

Snippets to help out with Android
8
star
11

IntentStub

An app for stubbing out built in Android apps for automated testing.
Java
8
star
12

android-wear-workshop

An example of how to use Android Wear, using Github Issues as an example.
Java
7
star
13

sketch-page-helpers

This plugin includes a few simple actions to make managing pages easier in Sketch.
5
star
14

slack-forecast

Simple web service to receive Forecast utilisation insights through a Slack command.
JavaScript
2
star
15

arcohol-ios

iOS Control for Arcohol Prototype
Swift
2
star
16

sketch-archive-artboard

JavaScript
2
star
17

arcohol-rpi

NodeJS Raspberry Pi server/client
JavaScript
2
star
18

riAPI

A simple API server to get information about the ribot team
JavaScript
1
star