Skip to content

Can't use beAnInstanceOf to match Expectations #38

@SunDog

Description

@SunDog

When comparing instances or classes the methods beAnInstanceOf and beAKindOf returns a Predicate<Any> but RxNimble expectation ask's for Predicate<T> instead.

Code:

let driverObject = Driver.just(Int())

// doesn't compile
expect(driverObject.asObservable()).first.to(beAnInstanceOf(Int.self))

// compile
let result = try! driverObject.asObservable().toBlocking().first()
expect(result).to(beAnInstanceOf(Int.self))

I don't know if it is as expected or if we can improve this.
Therefore I'm at your disposal to make a PR for this, but I would need some direction since I think this is not as easy as just changing the type of var first

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions