Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

throwError only works with Any #49

Open
t-unit opened this issue Jun 21, 2019 · 1 comment
Open

throwError only works with Any #49

t-unit opened this issue Jun 21, 2019 · 1 comment

Comments

@t-unit
Copy link
Member

t-unit commented Jun 21, 2019

When using:

expect(subject).[last|first|array].to(throwError())

the tests only compile if the element used is Any. Otherwise you get a compilation error.

So

let subject = ReplaySubject<**Any**>.createUnbounded()
subject.onError(AnyError.any)

expect(subject).first.to(throwError())

works.

While

let subject = ReplaySubject<**String**>.createUnbounded()
subject.onError(AnyError.any)

expect(subject).first.to(throwError())

proceses: Instance method 'to(_:description:)' requires the types 'String' and 'Any' be equivalent

This issue seems closely related to #38

@CassiusPacheco
Copy link

Hi there, I found out that Nimble has already merged in a generic ThrowError solution for this problem, however it's not out yet in the latest versions. However, if you fetch Nimble's code from master it works.

Have a look at this issue Quick/Nimble#737

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants