Some equality tests

@alazier @kspangsege 
The object is inserted into the new realm. A new row accessor is then
created and stored in obj-c object, so the obj-c accessor then belongs to
the new realm as you assumed.


On Wed, Jul 30, 2014 at 10:14 AM, Kristian Spangsege <
notifications@github.com> wrote:

> In Realm/Tests/ObjectTests.m:
>
> > +
> > +    [realm beginWriteTransaction];
> > +    [realm addObject: obj];
> > +    [realm commitWriteTransaction];
> > +
> > +    XCTAssertFalse([obj isEqual:otherObj], @"One in realm, the other is not.");
> > +    XCTAssertTrue([obj isEqual:[IntObject allObjects][0]], @"Same table and index.");
> > +
> > +    [otherRealm beginWriteTransaction];
> > +    [otherRealm addObject: otherObj];
> > +    [otherRealm commitWriteTransaction];
> > +
> > +    XCTAssertFalse([obj isEqual:otherObj], @"Different realms.");
> > +
> > +    [realm beginWriteTransaction];
> > +    [realm addObject: otherObj];
>
> @alazier <https://github.com/alazier> , can you clarify? What exactly
> happens when you add an object first to one Realm, and then to another
> Realm?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/realm/realm-cocoa/pull/711/files#r15597928>.
>