DeclarativeHub / ReactiveKit

A Swift Reactive Programming Kit
MIT License
1.24k stars 114 forks source link

[WIP] Add test observer class to test signal emission #247

Closed ibrahimkteish closed 4 years ago

ibrahimkteish commented 4 years ago

@srdanrasic Please review this idea if you find it useful we could extract the TestObserver class and make it part of the library so users could use it to test their reactive streams.

The main Idea is to create an TestObserver instance and make it observe the original signal we want to test against, then we will end up having tons of assert* methods to assert the expected output.

Waiting for your feedback

srdanrasic commented 4 years ago

I love this idea. I'll have a detailed look in the following days.

If move this to the framework, would there be any concerns around importing XCTest in the framework target?

ibrahimkteish commented 4 years ago

We could make a new target ReactiveKitTests where TestObserver lives and in the pod file for example the user's TestTarget needs to have pod ReactiveKitTests as dependency what do you think ?

ibrahimkteish commented 4 years ago

@srdanrasic any Updates ?

srdanrasic commented 4 years ago

Hey @ibrahimkteish, I was on a vacation.

I'm going to merge this into a separate branch. I'd love to keep things simple and avoid introducing a new target so I'm going to explore another option on top of your work. I'll let you know how it goes and then I'd be happy to hear your opinion.