Coder Social home page Coder Social logo

Handle method tear-off on mock about mockito HOT 4 CLOSED

a14n avatar a14n commented on July 20, 2024
Handle method tear-off on mock

from mockito.

Comments (4)

srawlins avatar srawlins commented on July 20, 2024

This has been decided for us by the Dart 2 language team. In general tearing off noSuchMethod calls is will not be supported in Dart 2. See #107 for more details.

from mockito.

lrhn avatar lrhn commented on July 20, 2024

I'm not sure this issue matches #107.
Rather, as I read it (and correct me if I'm wrong), this issue requests the behavior that will be in Dart 2.
The tear-off of a mock method "just works" - you can call the torn off method, and it works just as calling the original method.

Is the code here running in Dart 2 mode?

from mockito.

matanlurey avatar matanlurey commented on July 20, 2024

I don't think this is a Dart 2 issue - this just isn't supported.

The mechanics we use to detect the mock aren't compatible with NSM tear-offs.

from mockito.

matanlurey avatar matanlurey commented on July 20, 2024

Closing, it doesn't look like this is supported by Mockito and is unlikely to be possible.

You can always manually create a "tear-off" for this use case.

from mockito.

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.