Code Monkey home page Code Monkey logo

Comments (15)

lukeredpath avatar lukeredpath commented on July 20, 2024

You'r not missing something from what I can see; this seems like a bug. I'll look into it.

from kiwi.

allending avatar allending commented on July 20, 2024

Will look into this.

In the future, I'd like to request a tiny project or complete source file for specs that show bugs in Kiwi. This really makes tracking down issues quicker otherwise we may not even be motivated to take a look. It is quite a lot of effort to set up the environment to reproduce issues and the amount of time we can spend on maintenance is limited.

from kiwi.

allending avatar allending commented on July 20, 2024

Actually a sample project for this would be useful, I can't reproduce the problem.

from kiwi.

joefiorini avatar joefiorini commented on July 20, 2024

I ran into a similar issue last night. @lukeredpath have you gotten anywhere with it? I could try to create a sample project, but I'm currently working in against pre-release APIs and can't repro it consistently enough to do it in another project.

from kiwi.

timd avatar timd commented on July 20, 2024

I've hit this exact same issue:

it(@"should stub and mock stuff", ^{

    id testItem = [Item mock];
    [testItem stub:@selector(itemID) andReturn:[NSNumber numberWithInt:3]];

    NSNumber *theId = [testItem itemID];
    NSNumber *returnedId = [NSNumber numberWithInt:3];

    [[theId should] equal:returnedId];

});

The Item object is a vanilla NSManagedObject. I can extract those relevant bits out into a sample project if it would help...

from kiwi.

allending avatar allending commented on July 20, 2024

Running on sim on lion?

from kiwi.

timd avatar timd commented on July 20, 2024

Yes - I'm on 10.7.4, Xcode 4.3.3.

from kiwi.

nheagy avatar nheagy commented on July 20, 2024

Taking a guess at this without actually trying to reproduce it. Is itemID a dynamic property? If so, this may be a complicating factor.

from kiwi.

luisobo avatar luisobo commented on July 20, 2024

Any progress on this?

from kiwi.

allending avatar allending commented on July 20, 2024

Serious enough that will look at this as part of #176

from kiwi.

allending avatar allending commented on July 20, 2024

Main issue at the top of my head is that NSNumber isn't necessarily an object - memory wise.

from kiwi.

RuiAAPeres avatar RuiAAPeres commented on July 20, 2024

Any progress?

from kiwi.

stepanhruda avatar stepanhruda commented on July 20, 2024

I think the reason is, as @nheagy suggested, that itemID is a dynamic property and Kiwi cannot currently handle this. I don't know the underlying reason from the top of my head and whether it can be easily fixed. . To avoid this crash, instead of [Item mock] create an in-memory managed object context and insert the object there.

from kiwi.

supermarin avatar supermarin commented on July 20, 2024

Yeah, the property is dynamic, and NSManagedObject does it's own magic.
Let's leave this open, if I find some time I'll try to figure it out

from kiwi.

supermarin avatar supermarin commented on July 20, 2024

Closing this one, will open a new one for discussion of @dynamic / NSManagedObject properties.

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.