💀 Add test skeletons

This commit is contained in:
Ben Chatelain 2018-12-28 15:23:22 -07:00
parent afca0c6c50
commit 5a99645380
12 changed files with 320 additions and 1 deletions

View file

@ -0,0 +1,25 @@
//
// AccountCommandSpec.swift
// MasKitTests
//
// Created by Ben Chatelain on 2018-12-28.
// Copyright © 2018 mas-cli. All rights reserved.
//
@testable import MasKit
import Result
import Quick
import Nimble
class AccountCommandSpec: QuickSpec {
override func spec() {
describe("Account command") {
it("displays active account") {
let cmd = AccountCommand()
let result = cmd.run(AccountCommand.Options())
print(result)
// expect(result).to(beSuccess())
}
}
}
}

View file

@ -0,0 +1,25 @@
//
// InfoCommandSpec.swift
// MasKitTests
//
// Created by Ben Chatelain on 2018-12-28.
// Copyright © 2018 mas-cli. All rights reserved.
//
@testable import MasKit
import Result
import Quick
import Nimble
class InfoCommandSpec: QuickSpec {
override func spec() {
describe("Info command") {
it("displays app details") {
let cmd = InfoCommand()
let result = cmd.run(InfoCommand.Options(appId: ""))
print(result)
// expect(result).to(beSuccess())
}
}
}
}

View file

@ -0,0 +1,25 @@
//
// InstallCommandSpec.swift
// MasKitTests
//
// Created by Ben Chatelain on 2018-12-28.
// Copyright © 2018 mas-cli. All rights reserved.
//
@testable import MasKit
import Result
import Quick
import Nimble
class InstallCommandSpec: QuickSpec {
override func spec() {
describe("install command") {
it("installs apps") {
let cmd = InstallCommand()
let result = cmd.run(InstallCommand.Options(appIds: [], forceInstall: false))
print(result)
// expect(result).to(beSuccess())
}
}
}
}

View file

@ -0,0 +1,25 @@
//
// LuckyCommandSpec.swift
// MasKitTests
//
// Created by Ben Chatelain on 2018-12-28.
// Copyright © 2018 mas-cli. All rights reserved.
//
@testable import MasKit
import Result
import Quick
import Nimble
class LuckyCommandSpec: QuickSpec {
override func spec() {
describe("lucky command") {
it("installs the first app matching a search") {
let cmd = LuckyCommand()
let result = cmd.run(LuckyCommand.Options(appName: "", forceInstall: false))
print(result)
// expect(result).to(beSuccess())
}
}
}
}

View file

@ -0,0 +1,25 @@
//
// OutdatedCommandSpec.swift
// MasKitTests
//
// Created by Ben Chatelain on 2018-12-28.
// Copyright © 2018 mas-cli. All rights reserved.
//
@testable import MasKit
import Result
import Quick
import Nimble
class OutdatedCommandSpec: QuickSpec {
override func spec() {
describe("outdated command") {
it("displays apps with pending updates") {
let cmd = OutdatedCommand()
let result = cmd.run(OutdatedCommand.Options())
print(result)
// expect(result).to(beSuccess())
}
}
}
}

View file

@ -0,0 +1,25 @@
//
// ResetCommandSpec.swift
// MasKitTests
//
// Created by Ben Chatelain on 2018-12-28.
// Copyright © 2018 mas-cli. All rights reserved.
//
@testable import MasKit
import Result
import Quick
import Nimble
class ResetCommandSpec: QuickSpec {
override func spec() {
describe("reset command") {
it("updates stuff") {
let cmd = ResetCommand()
let result = cmd.run(ResetCommand.Options(debug: false))
print(result)
// expect(result).to(beSuccess())
}
}
}
}

View file

@ -0,0 +1,25 @@
//
// SearchCommandSpec.swift
// MasKitTests
//
// Created by Ben Chatelain on 2018-12-28.
// Copyright © 2018 mas-cli. All rights reserved.
//
@testable import MasKit
import Result
import Quick
import Nimble
class SearchCommandSpec: QuickSpec {
override func spec() {
describe("search command") {
it("updates stuff") {
let cmd = SearchCommand()
let result = cmd.run(SearchCommand.Options(appName: "", price: false))
print(result)
// expect(result).to(beSuccess())
}
}
}
}

View file

@ -0,0 +1,25 @@
//
// SignInCommandSpec.swift
// MasKitTests
//
// Created by Ben Chatelain on 2018-12-28.
// Copyright © 2018 mas-cli. All rights reserved.
//
@testable import MasKit
import Result
import Quick
import Nimble
class SignInCommandSpec: QuickSpec {
override func spec() {
describe("signn command") {
it("updates stuff") {
let cmd = SignInCommand()
let result = cmd.run(SignInCommand.Options(username: "", password: "", dialog: false))
print(result)
// expect(result).to(beSuccess())
}
}
}
}

View file

@ -0,0 +1,25 @@
//
// SignOutCommandSpec.swift
// MasKitTests
//
// Created by Ben Chatelain on 2018-12-28.
// Copyright © 2018 mas-cli. All rights reserved.
//
@testable import MasKit
import Result
import Quick
import Nimble
class SignOutCommandSpec: QuickSpec {
override func spec() {
describe("signout command") {
it("updates stuff") {
let cmd = SignOutCommand()
let result = cmd.run(SignOutCommand.Options())
print(result)
// expect(result).to(beSuccess())
}
}
}
}

View file

@ -0,0 +1,25 @@
//
// UpgradeCommandSpec.swift
// MasKitTests
//
// Created by Ben Chatelain on 2018-12-28.
// Copyright © 2018 mas-cli. All rights reserved.
//
@testable import MasKit
import Result
import Quick
import Nimble
class UpgradeCommandSpec: QuickSpec {
override func spec() {
describe("upgrade command") {
it("updates stuff") {
let cmd = UpgradeCommand()
let result = cmd.run(UpgradeCommand.Options(apps: [""]))
print(result)
// expect(result).to(beSuccess())
}
}
}
}

View file

@ -0,0 +1,25 @@
//
// VersionCommandSpec.swift
// MasKitTests
//
// Created by Ben Chatelain on 2018-12-28.
// Copyright © 2018 mas-cli. All rights reserved.
//
@testable import MasKit
import Result
import Quick
import Nimble
class VersionCommandSpec: QuickSpec {
override func spec() {
describe("version command") {
it("displays the current version") {
let cmd = VersionCommand()
let result = cmd.run(VersionCommand.Options())
print(result)
// expect(result).to(beSuccess())
}
}
}
}

View file

@ -31,6 +31,17 @@
B594B13021D5855D00F3AC59 /* MasAppLibrary.swift in Sources */ = {isa = PBXBuildFile; fileRef = B594B12F21D5855D00F3AC59 /* MasAppLibrary.swift */; };
B594B13221D5876200F3AC59 /* ResultPredicates.swift in Sources */ = {isa = PBXBuildFile; fileRef = B594B13121D5876200F3AC59 /* ResultPredicates.swift */; };
B594B13421D5897100F3AC59 /* MockSoftwareProduct.swift in Sources */ = {isa = PBXBuildFile; fileRef = B594B13321D5897100F3AC59 /* MockSoftwareProduct.swift */; };
B594B13621D6D68600F3AC59 /* VersionCommandSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = B594B13521D6D68600F3AC59 /* VersionCommandSpec.swift */; };
B594B13821D6D6C100F3AC59 /* UpgradeCommandSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = B594B13721D6D6C100F3AC59 /* UpgradeCommandSpec.swift */; };
B594B13A21D6D70400F3AC59 /* SignOutCommandSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = B594B13921D6D70400F3AC59 /* SignOutCommandSpec.swift */; };
B594B13C21D6D72E00F3AC59 /* SignInCommandSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = B594B13B21D6D72E00F3AC59 /* SignInCommandSpec.swift */; };
B594B13E21D6D78900F3AC59 /* SearchCommandSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = B594B13D21D6D78900F3AC59 /* SearchCommandSpec.swift */; };
B594B14021D6D8BF00F3AC59 /* ResetCommandSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = B594B13F21D6D8BF00F3AC59 /* ResetCommandSpec.swift */; };
B594B14221D6D8EC00F3AC59 /* OutdatedCommandSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = B594B14121D6D8EC00F3AC59 /* OutdatedCommandSpec.swift */; };
B594B14421D6D91800F3AC59 /* LuckyCommandSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = B594B14321D6D91800F3AC59 /* LuckyCommandSpec.swift */; };
B594B14621D6D95700F3AC59 /* InstallCommandSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = B594B14521D6D95700F3AC59 /* InstallCommandSpec.swift */; };
B594B14821D6D98400F3AC59 /* InfoCommandSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = B594B14721D6D98400F3AC59 /* InfoCommandSpec.swift */; };
B594B14A21D6D9AE00F3AC59 /* AccountCommandSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = B594B14921D6D9AE00F3AC59 /* AccountCommandSpec.swift */; };
ED031A7C1B5127C00097692E /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED031A7B1B5127C00097692E /* main.swift */; };
F83213892173D3E1008BA8A0 /* CKAccountStore.h in Headers */ = {isa = PBXBuildFile; fileRef = F8FB719B20F2EC4500F56FDC /* CKAccountStore.h */; };
F832138A2173D3E1008BA8A0 /* CKDownloadQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = F8FB719C20F2EC4500F56FDC /* CKDownloadQueue.h */; };
@ -174,6 +185,17 @@
B594B12F21D5855D00F3AC59 /* MasAppLibrary.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MasAppLibrary.swift; sourceTree = "<group>"; };
B594B13121D5876200F3AC59 /* ResultPredicates.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResultPredicates.swift; sourceTree = "<group>"; };
B594B13321D5897100F3AC59 /* MockSoftwareProduct.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockSoftwareProduct.swift; sourceTree = "<group>"; };
B594B13521D6D68600F3AC59 /* VersionCommandSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VersionCommandSpec.swift; sourceTree = "<group>"; };
B594B13721D6D6C100F3AC59 /* UpgradeCommandSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UpgradeCommandSpec.swift; sourceTree = "<group>"; };
B594B13921D6D70400F3AC59 /* SignOutCommandSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SignOutCommandSpec.swift; sourceTree = "<group>"; };
B594B13B21D6D72E00F3AC59 /* SignInCommandSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SignInCommandSpec.swift; sourceTree = "<group>"; };
B594B13D21D6D78900F3AC59 /* SearchCommandSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchCommandSpec.swift; sourceTree = "<group>"; };
B594B13F21D6D8BF00F3AC59 /* ResetCommandSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResetCommandSpec.swift; sourceTree = "<group>"; };
B594B14121D6D8EC00F3AC59 /* OutdatedCommandSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OutdatedCommandSpec.swift; sourceTree = "<group>"; };
B594B14321D6D91800F3AC59 /* LuckyCommandSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LuckyCommandSpec.swift; sourceTree = "<group>"; };
B594B14521D6D95700F3AC59 /* InstallCommandSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InstallCommandSpec.swift; sourceTree = "<group>"; };
B594B14721D6D98400F3AC59 /* InfoCommandSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InfoCommandSpec.swift; sourceTree = "<group>"; };
B594B14921D6D9AE00F3AC59 /* AccountCommandSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AccountCommandSpec.swift; sourceTree = "<group>"; };
ED031A781B5127C00097692E /* mas */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = mas; sourceTree = BUILT_PRODUCTS_DIR; };
ED031A7B1B5127C00097692E /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
ED0F237E1B87522400AE40CD /* Install.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Install.swift; sourceTree = "<group>"; };
@ -280,9 +302,20 @@
B594B12321D57FF300F3AC59 /* Commands */ = {
isa = PBXGroup;
children = (
B594B14921D6D9AE00F3AC59 /* AccountCommandSpec.swift */,
B594B14721D6D98400F3AC59 /* InfoCommandSpec.swift */,
B594B14521D6D95700F3AC59 /* InstallCommandSpec.swift */,
B594B12121D5416100F3AC59 /* ListCommandSpec.swift */,
B594B12421D580BB00F3AC59 /* UninstallCommandSpec.swift */,
B594B14321D6D91800F3AC59 /* LuckyCommandSpec.swift */,
B594B14121D6D8EC00F3AC59 /* OutdatedCommandSpec.swift */,
B594B13F21D6D8BF00F3AC59 /* ResetCommandSpec.swift */,
B594B13D21D6D78900F3AC59 /* SearchCommandSpec.swift */,
B555292C219A1FE700ACB4CA /* SearchSpec.swift */,
B594B13B21D6D72E00F3AC59 /* SignInCommandSpec.swift */,
B594B13921D6D70400F3AC59 /* SignOutCommandSpec.swift */,
B594B12421D580BB00F3AC59 /* UninstallCommandSpec.swift */,
B594B13721D6D6C100F3AC59 /* UpgradeCommandSpec.swift */,
B594B13521D6D68600F3AC59 /* VersionCommandSpec.swift */,
);
path = Commands;
sourceTree = "<group>";
@ -667,11 +700,22 @@
B5793E2B219BE0CD00135B39 /* MockURLSession.swift in Sources */,
B555292B219A1CB200ACB4CA /* MASErrorTestCase.swift in Sources */,
B594B13421D5897100F3AC59 /* MockSoftwareProduct.swift in Sources */,
B594B14421D6D91800F3AC59 /* LuckyCommandSpec.swift in Sources */,
B594B12221D5416100F3AC59 /* ListCommandSpec.swift in Sources */,
B594B13C21D6D72E00F3AC59 /* SignInCommandSpec.swift in Sources */,
B594B13A21D6D70400F3AC59 /* SignOutCommandSpec.swift in Sources */,
B594B12521D580BB00F3AC59 /* UninstallCommandSpec.swift in Sources */,
B594B13E21D6D78900F3AC59 /* SearchCommandSpec.swift in Sources */,
B594B13821D6D6C100F3AC59 /* UpgradeCommandSpec.swift in Sources */,
B594B14821D6D98400F3AC59 /* InfoCommandSpec.swift in Sources */,
B555292D219A1FE700ACB4CA /* SearchSpec.swift in Sources */,
B594B14621D6D95700F3AC59 /* InstallCommandSpec.swift in Sources */,
B594B14021D6D8BF00F3AC59 /* ResetCommandSpec.swift in Sources */,
B594B12E21D5850700F3AC59 /* MockAppLibrary.swift in Sources */,
B594B14221D6D8EC00F3AC59 /* OutdatedCommandSpec.swift in Sources */,
B594B13221D5876200F3AC59 /* ResultPredicates.swift in Sources */,
B594B14A21D6D9AE00F3AC59 /* AccountCommandSpec.swift in Sources */,
B594B13621D6D68600F3AC59 /* VersionCommandSpec.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};