Coder Social home page Coder Social logo

Improve Test Fail Message about kiwi HOT 2 CLOSED

kiwi-bdd avatar kiwi-bdd commented on August 17, 2024
Improve Test Fail Message

from kiwi.

Comments (2)

lukeredpath avatar lukeredpath commented on August 17, 2024

As things stand, this is very difficult. When you call:

[nil should]

two verifiers are created (a match verifier, and an exist verifier). These verifiers are passed to a method call attachToVerifier:verifier: on the subject. Of course, if the subject is nil, the verifiers are still created but the attachToVerifier:verifier: call does nothing as it is being sent to nil.

It is only when attachToVerifier:verifier: that the subject is set on the verifier (this is how the exist verifier works with nil values - because attachToVerifier:verifier: is never called and the subject is never set on the verifier, it knows it was nil). So we can still do a nil check and return the error message you see above.

The problem is however, that the matcher methods (equal: in your example) are sent to and handled by the verifier object returned by attachToVerifier:verifier. As this is never called, nothing is returned and equal: is being sent to nil. Therefore there is never any way to know what matcher method you have called and no way to provide a more detailed error message (as this is handled by the matcher).

from kiwi.

allending avatar allending commented on August 17, 2024

Closing.

from kiwi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.