mirror of
https://github.com/modo-studio/SugarRecord.git
synced 2024-09-11 14:36:41 +03:00
Removed no-use-binaries from travis script
This commit is contained in:
parent
3f83ce68ba
commit
87ac7a0a58
@ -5,7 +5,7 @@ notifications:
|
||||
install:
|
||||
- brew install carthage
|
||||
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
|
||||
- carthage update --no-use-binaries
|
||||
- carthage update
|
||||
script:
|
||||
- make build
|
||||
- make test
|
||||
|
@ -23,6 +23,7 @@
|
||||
2305F9001BF1EA8D00F9D379 /* Entity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2305F8FE1BF1EA8D00F9D379 /* Entity.swift */; };
|
||||
2305F9011BF1EA8D00F9D379 /* Entity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2305F8FE1BF1EA8D00F9D379 /* Entity.swift */; };
|
||||
230CBDC21BF37F7A00C43A48 /* ResultsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 230CBDC11BF37F7900C43A48 /* ResultsTests.swift */; };
|
||||
230CBDC61BF383D700C43A48 /* RealmDefaultStorageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 230CBDC51BF383D700C43A48 /* RealmDefaultStorageTests.swift */; };
|
||||
2353E6391BED4AC00081E6E7 /* NSManagedObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2353E6281BED4AC00081E6E7 /* NSManagedObject.swift */; };
|
||||
2353E63A1BED4AC00081E6E7 /* NSManagedObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2353E6281BED4AC00081E6E7 /* NSManagedObject.swift */; };
|
||||
2353E63B1BED4AC00081E6E7 /* NSManagedObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2353E6281BED4AC00081E6E7 /* NSManagedObject.swift */; };
|
||||
@ -173,6 +174,7 @@
|
||||
2305F8FA1BF1EA5900F9D379 /* Object.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Object.swift; sourceTree = "<group>"; };
|
||||
2305F8FE1BF1EA8D00F9D379 /* Entity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Entity.swift; sourceTree = "<group>"; };
|
||||
230CBDC11BF37F7900C43A48 /* ResultsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResultsTests.swift; sourceTree = "<group>"; };
|
||||
230CBDC51BF383D700C43A48 /* RealmDefaultStorageTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RealmDefaultStorageTests.swift; sourceTree = "<group>"; };
|
||||
2353E6281BED4AC00081E6E7 /* NSManagedObject.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSManagedObject.swift; sourceTree = "<group>"; };
|
||||
2353E6291BED4AC00081E6E7 /* NSManagedObjectContext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSManagedObjectContext.swift; sourceTree = "<group>"; };
|
||||
2353E62B1BED4AC00081E6E7 /* CoreDataDefaultStorage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoreDataDefaultStorage.swift; sourceTree = "<group>"; };
|
||||
@ -532,6 +534,7 @@
|
||||
23B15C551BF353530059008E /* Storages */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
230CBDC51BF383D700C43A48 /* RealmDefaultStorageTests.swift */,
|
||||
);
|
||||
path = Storages;
|
||||
sourceTree = "<group>";
|
||||
@ -1105,6 +1108,7 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
230CBDC61BF383D700C43A48 /* RealmDefaultStorageTests.swift in Sources */,
|
||||
23B15C521BF352AD0059008E /* Issue.swift in Sources */,
|
||||
3DE3FD961BF12B8C00009071 /* DataModel.xcdatamodeld in Sources */,
|
||||
230CBDC21BF37F7A00C43A48 /* ResultsTests.swift in Sources */,
|
||||
|
@ -0,0 +1,77 @@
|
||||
import Foundation
|
||||
import Quick
|
||||
import Nimble
|
||||
import RealmSwift
|
||||
|
||||
@testable import SugarRecord
|
||||
|
||||
class RealmDefaultStorageTests: QuickSpec {
|
||||
|
||||
override func spec() {
|
||||
|
||||
var storage: RealmDefaultStorage?
|
||||
|
||||
beforeEach {
|
||||
storage = RealmDefaultStorage()
|
||||
}
|
||||
|
||||
afterEach {
|
||||
_ = try? storage?.removeStore()
|
||||
}
|
||||
|
||||
|
||||
describe("storage information") {
|
||||
|
||||
it("should have the proper description") {
|
||||
expect(storage?.description) == "RealmDefaultStorage"
|
||||
}
|
||||
|
||||
it("should have the proper type") {
|
||||
expect(storage?.type) == .Realm
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
describe("context generation") {
|
||||
|
||||
it("should return a memory realm for the memory context") {
|
||||
let memoryRealm: Realm? = storage?.memoryContext as? Realm
|
||||
expect(memoryRealm?.configuration.inMemoryIdentifier) == "MemoryRealm"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
describe("store operations") {
|
||||
|
||||
context("removal") {
|
||||
|
||||
it("should remove the storage") {
|
||||
_ = try? storage?.removeStore()
|
||||
let path = try? Realm().path
|
||||
expect(NSFileManager.defaultManager().fileExistsAtPath(path!)) == false
|
||||
}
|
||||
|
||||
it("shouldn't throw an exception") {
|
||||
expect{ try storage!.removeStore() }.toNot(throwError())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
describe("operations") {
|
||||
|
||||
it("should save the changes if write is passed as true") {
|
||||
storage?.operation(dispatch_get_main_queue(), write: true, operation: { (context) -> Void in
|
||||
let issue: Issue = context.insert().value!
|
||||
issue.name = "test"
|
||||
})
|
||||
let fetched = storage?.mainContext.fetch(Request<Issue>()).value
|
||||
expect(fetched?.count) == 1
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user