a9dbdcf629
Wow, lots of changes in Swift 2.0! And all of them great, except for renaming println to print. What's up with that? This is just to get it to compile, we will be trying and throwing errors in no time.
35 lines
938 B
Swift
35 lines
938 B
Swift
//
|
|
// Files_Tests.swift
|
|
// SwiftShell
|
|
//
|
|
// Created by Kåre Morstøl on 25.11.14.
|
|
// Copyright (c) 2014 NotTooBad Software. All rights reserved.
|
|
//
|
|
|
|
import SwiftShell
|
|
import XCTest
|
|
|
|
class Files_Tests: XCTestCase {
|
|
|
|
func testTempDirectory_IsTheSameAfterRepeatedCalls () {
|
|
XCTAssertEqual( tempdirectory, tempdirectory )
|
|
}
|
|
|
|
func testWorkDirectory_IsCurrentDirectory () {
|
|
XCTAssertEqual( workdirectory, NSFileManager.defaultManager().currentDirectoryPath )
|
|
}
|
|
|
|
func testWorkDirectory_CanChange () {
|
|
workdirectory = "/tmp"
|
|
|
|
XCTAssertEqual( workdirectory, "/private/tmp" )
|
|
XCTAssertEqual( $("pwd"), "/tmp" )
|
|
}
|
|
|
|
func testURLConcatenationOperator () {
|
|
XCTAssertEqual( "/directory" / "file.extension", "/directory/file.extension" )
|
|
XCTAssertEqual( "/root" / "directory" / "file.extension", "/root/directory/file.extension" )
|
|
XCTAssertEqual( "directory" / "file.extension", workdirectory + "/directory/file.extension" )
|
|
}
|
|
}
|