Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
noppoMan committed Dec 27, 2018
1 parent c1c85ff commit 017c82b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 72 deletions.
35 changes: 0 additions & 35 deletions Tests/HexavilleTests/DotEnvParserTests.swift

This file was deleted.

38 changes: 2 additions & 36 deletions Tests/HexavilleTests/HexavilleFileTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,54 +25,20 @@ swift:
docker:
buildOptions:
nocache: true
provider:
aws:
credential:
accessKeyId: access_key
secretAccessKey: secret_access_key
region: ap-northeast-1
lambda:
s3Bucket: hexaville-test-app-8uh-bucket
role: arn:aws:iam::foo:role/lambda_basic_execution
timeout: 20
memory: 512
vpc:
subnetIds:
- subnet-foo-bar
- subnet-bar-foo
securityGroupIds:
- sg-foo-bar
- sg-bar-foo
"""
}

static var allTests = [
("testloadAWS", testloadAWS),
("testload", testload),
]

func testloadAWS() {
func testload() {
do {
let hexavilleFile = try HexavilleFile.load(ymlString: hexavillefileForAWS)

XCTAssertEqual(hexavilleFile.appName, "testApp")
XCTAssert(hexavilleFile.docker!.buildOptions.nocache!)
XCTAssertEqual(hexavilleFile.swift.buildMode.rawValue, "release")

switch hexavilleFile.provider {
case .aws(let config):
XCTAssertEqual(config.credential?.accessKeyId, "access_key")
XCTAssertEqual(config.credential?.secretAccessKey, "secret_access_key")
XCTAssertEqual(config.region, "ap-northeast-1")

XCTAssertEqual(config.lambda.s3Bucket, "hexaville-test-app-8uh-bucket")
XCTAssertEqual(config.lambda.role, "arn:aws:iam::foo:role/lambda_basic_execution")
XCTAssertEqual(config.lambda.timeout, 20)
XCTAssertEqual(config.lambda.memory, 512)
XCTAssertEqual(config.lambda.vpc!.subnetIds, ["subnet-foo-bar", "subnet-bar-foo"])
XCTAssertEqual(config.lambda.vpc!.securityGroupIds, ["sg-foo-bar", "sg-bar-foo"])
}

XCTAssertEqual(hexavilleFile.swift.version.asCompareableVersion(), Version(major: 4, minor: 2))

} catch {
Expand Down
1 change: 0 additions & 1 deletion Tests/LinuxMain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import XCTest

XCTMain([
testCase(HexavilefileLoaderTest.allTests),
testCase(DotEnvParserTests.allTests),
testCase(SwiftVersionTests.allTests),
testCase(EventEmitterTests.allTests)
])

0 comments on commit 017c82b

Please sign in to comment.