Skip to content

Commit

Permalink
Merge pull request #15 from Yasumoto/master
Browse files Browse the repository at this point in the history
Upgrade to Fluent 1.3 and add Serializer test
  • Loading branch information
tanner0101 authored Jan 12, 2017
2 parents fec46a2 + e9e35ed commit d897d2c
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ Sources/main.swift
.build
Packages
Database
*.xcodeproj
*.xcodeproj
database.db
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PackageDescription
let package = Package(
name: "FluentSQLite",
dependencies: [
.Package(url: "https://github.com/vapor/sqlite.git", majorVersion: 1, minor: 0),
.Package(url: "https://github.com/vapor/fluent.git", majorVersion: 1, minor: 0),
.Package(url: "https://github.com/vapor/sqlite.git", majorVersion: 1),
.Package(url: "https://github.com/vapor/fluent.git", majorVersion: 1),
]
)
20 changes: 20 additions & 0 deletions Tests/FluentSQLiteTests/SQLiteSerializerTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import XCTest
@testable import FluentSQLite
@testable import Fluent

class SQLiteSerializerTests : XCTestCase {
static let allTests = {
return [
("testSql", testSql)
]
}

var serializer:SQLiteSerializer!

func testSql() {
serializer = SQLiteSerializer(sql: SQL.count(table: "testTable", filters: [], joins: []))
let (output, nodes) = serializer.serialize()
XCTAssertEqual(output, "SELECT COUNT(*) as _fluent_count FROM `testTable`")
XCTAssertEqual(nodes, [])
}
}
1 change: 1 addition & 0 deletions Tests/FluentSQLiteTests/Utilities/Atom.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ final class Atom: Entity {
var id: Node?
var name: String
var protons: Int
var exists: Bool = false

init(name: String, protons: Int) {
self.name = name
Expand Down
1 change: 1 addition & 0 deletions Tests/FluentSQLiteTests/Utilities/Compound.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Fluent
final class Compound: Entity {
var id: Node?
var name: String
var exists: Bool = false

init(name: String) {
self.name = name
Expand Down
1 change: 1 addition & 0 deletions Tests/FluentSQLiteTests/Utilities/Post.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ final class Post: Entity {
var id: Fluent.Node?
var title: String
var text: String
var exists: Bool = false

init(id: Node?, title: String, text: String) {
self.id = id
Expand Down

0 comments on commit d897d2c

Please sign in to comment.