Test In-memory Database

This commit is contained in:
Gwendal Roué committed 2015-07-04 18:09:42 +02:00
1 parent 449042d62e
commit 640b8dc60e
1 file changed
+26
+26
View File
@@ -0,0 +1,26 @@
//
// InMemoryDatabaseTests.swift
// GRDB
//
// Created by Gwendal Roué on 04/07/2015.
// Copyright © 2015 Gwendal Roué. All rights reserved.
//
import XCTest
import GRDB
class InMemoryDatabaseTests : GRDBTestCase
{
func testInMemoryDatabase() {
assertNoError {
let dbQueue = try DatabaseQueue()
try dbQueue.inTransaction { db in
try db.execute("CREATE TABLE foo (bar TEXT)")
try db.execute("INSERT INTO foo (bar) VALUES ('baz')")
let baz = db.fetchOne(String.self, "SELECT bar FROM foo")!
XCTAssertEqual(baz, "baz")
return .Rollback
}
}
}
}