Skip to content

Commit 915f1be

Browse files
committed
Added RxTest support to Changelog and updated README
1 parent d9a6b9e commit 915f1be

File tree

2 files changed

+39
-3
lines changed

2 files changed

+39
-3
lines changed

Changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Current Master
44

5-
- Nothing yet.
5+
- Added support to RxTest. Users may now choose between `RxTest` and `RxBlocking` (or both)
66

77
## 4.3.0
88
- Swift 4.2 support

README.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,48 @@ expect(observable).first == 42
2323

2424
Nice.
2525

26+
---
27+
28+
If on the other hand you'd rather use [RxTest](http://cocoapods.org/pods/RxTest) instead of `RxBlocking`, you can do it by specifying RxNimble's `RxTest` subspec. With _RxTest_ you can have more powerful tests, checking a stream as a whole instead of being limited to `first`, `last` and `array` (while the last 2 implicitly require the stream to have completed).
29+
30+
That means _RxTest_ allows you to verify the occurrence of multiple `next`, `error` and `completed` events at specific virtual times:
31+
32+
```
33+
expect(subject).events(scheduler: scheduler, disposeBag: disposeBag)
34+
.to(equal([
35+
Recorded.next(5, "Hello"),
36+
Recorded.next(10, "World"),
37+
Recorded.completed(100)
38+
]))
39+
```
40+
41+
You may also verify specific error types:
42+
43+
```
44+
expect(imageSubject).events(scheduler: scheduler, disposeBag: disposeBag)
45+
.to(equal([
46+
Recorded.error(5, ImageError.invalidImage)
47+
]))
48+
```
49+
2650
## Installation
2751

28-
Add to your podfile:
52+
Add to the tests target in your Podfile:
53+
54+
```rb
55+
pod 'RxNimble' # same as RxNimble/RxBlocking
56+
```
57+
58+
or
59+
60+
```rb
61+
pod 'RxNimble/RxTest' # installs RxTest instead of RxBlocking
62+
```
63+
64+
or even
2965

3066
```rb
31-
pod 'RxNimble'
67+
pod 'RxNimble', subspecs: ['RxBlocking', 'RxTest'] # installs both dependencies
3268
```
3369

3470
And `pod install` and that's it!

0 commit comments

Comments
 (0)