         let realm = Realm()
         assertThrows(realm.add(SwiftObject()))
         XCTAssertEqual(0, realm.objects(SwiftObject).count)
-        realm.write {
-            let obj = SwiftObject()
-            realm.add(obj)
+        var defaultRealmObject: SwiftObject!
+        realm.write {
+            defaultRealmObject = SwiftObject()
+            realm.add(defaultRealmObject)
             XCTAssertEqual(1, realm.objects(SwiftObject).count)
-            realm.add(obj)
+            realm.add(defaultRealmObject)
             XCTAssertEqual(1, realm.objects(SwiftObject).count)
         }
         XCTAssertEqual(1, realm.objects(SwiftObject).count)
+
+        let testRealm = realmWithTestPath()
+        testRealm.write {
+            self.assertThrows(testRealm.add(defaultRealmObject))
+        }
     }
 
     func testAddMultipleObjects() {

            XCTAssertEqual(2, realm.objects(SwiftObject).count)
        }
        XCTAssertEqual(2, realm.objects(SwiftObject).count)
    }

    func testAddOrUpdateSingleObject() {
        let realm = Realm()
        XCTAssertEqual(0, realm.objects(SwiftPrimaryStringObject).count)
        realm.write {
            let obj = SwiftPrimaryStringObject()
            realm.addOrUpdate(obj)
            XCTAssertEqual(1, realm.objects(SwiftPrimaryStringObject).count)
        }
        XCTAssertEqual(1, realm.objects(SwiftPrimaryStringObject).count)
    }

    func testAddOrUpdateMultipleObjects() {

            XCTAssertEqual(1, realm.objects(SwiftPrimaryStringObject).count)
        }
        XCTAssertEqual(1, realm.objects(SwiftPrimaryStringObject).count)

        let testRealm = realmWithTestPath()
        testRealm.write {
            self.assertThrows(testRealm.addOrUpdate(realm.objects(SwiftPrimaryStringObject)))
        }
    }

    func testDeleteSingleObject() {
        let realm = Realm()
        XCTAssertEqual(0, realm.objects(SwiftObject).count)
        assertThrows(realm.delete(SwiftObject()))
        var defaultRealmObject: SwiftObject!
        realm.write {
            defaultRealmObject = SwiftObject()
            self.assertThrows(realm.delete(defaultRealmObject))
            XCTAssertEqual(0, realm.objects(SwiftObject).count)
            realm.add(defaultRealmObject)
            XCTAssertEqual(1, realm.objects(SwiftObject).count)
            realm.delete(defaultRealmObject)
            XCTAssertEqual(0, realm.objects(SwiftObject).count)
        }
        assertThrows(realm.delete(defaultRealmObject))
        XCTAssertEqual(0, realm.objects(SwiftObject).count)

        let testRealm = realmWithTestPath()
        assertThrows(testRealm.delete(defaultRealmObject))
        testRealm.write {
            self.assertThrows(testRealm.delete(defaultRealmObject))
        }
    }

    func testDeleteListOfObjects() {
