import XCTest
@testable import SwiftdaKit

class EndToEndTests: XCTestCase {
    func testSimple() throws {
        try SetupCommand().command()
        
        InitCommand().command(name: "e2e-test")

        let fm = FileManager.default
        let cwd = fm.currentDirectoryPath

        fm.changeCurrentDirectoryPath("e2e-test")
        let lambdaDir = fm.currentDirectoryPath

        defer {
            fm.changeCurrentDirectoryPath(cwd)
            try! fm.removeItem(atPath: lambdaDir)
        }

        try BuildCommand().command()
        try DeployCommand().command(newVersion: false)

        let output = try InvokeCommand().invoke(async: false, local: false)
        XCTAssert(output.range(of: "Hello, World") != nil)

        try DestroyCommand().command()
    }

    static var allTests: [(String, (EndToEndTests) -> () throws -> Void)] {
        return [
        ]
    }
}

import XCTest
@testable import SwiftdaKit

class EndToEndTests: XCTestCase {
    func testSimple() throws {
        try SetupCommand().command()
        
        InitCommand().command(name: "e2e-test")

        let fm = FileManager.default
        let cwd = fm.currentDirectoryPath

        fm.changeCurrentDirectoryPath("e2e-test")
        let lambdaDir = fm.currentDirectoryPath

        defer {
            fm.changeCurrentDirectoryPath(cwd)
            try! fm.removeItem(atPath: lambdaDir)
        }

        try BuildCommand().command()
        try DeployCommand().command(newVersion: false)

        let output = try InvokeCommand().invoke(async: false, local: false)
        XCTAssert(output.range(of: "Hello, world!") != nil)

        try DestroyCommand().command()
    }

    static var allTests: [(String, (EndToEndTests) -> () throws -> Void)] {
        return [
        ]
    }
}

--- 
+++ 
@@ -22,7 +22,7 @@
         try DeployCommand().command(newVersion: false)
 
         let output = try InvokeCommand().invoke(async: false, local: false)
-        XCTAssert(output.range(of: "Hello, world!") != nil)
+        XCTAssert(output.range(of: "Hello, World") != nil)
 
         try DestroyCommand().command()
     }
Change expected text in E2E test to reflect new example
