-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from Oni-zerone/feature/Pipeline-refactor
Pipeline refactor
- Loading branch information
Showing
14 changed files
with
411 additions
and
150 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// | ||
// PipeTests.swift | ||
// PowerTools_Tests | ||
// | ||
// Created by Andrea Altea on 16/06/2019. | ||
// Copyright © 2019 CocoaPods. All rights reserved. | ||
// | ||
|
||
import XCTest | ||
@testable import PowerTools | ||
|
||
class PipeTests: XCTestCase { | ||
|
||
var pipe: PowerTools.Pipe<String>! | ||
var assertPipe: AssertPipe<String>! | ||
|
||
override func setUp() { | ||
super.setUp() | ||
self.pipe = Pipe() | ||
self.assertPipe = AssertPipe() | ||
self.pipe.nextPipe = assertPipe | ||
} | ||
|
||
override func tearDown() { | ||
self.pipe = nil | ||
self.assertPipe = nil | ||
super.tearDown() | ||
} | ||
|
||
func testPipelineSucccess() { | ||
|
||
assertPipe.successExpectation = expectation(description: "success") | ||
self.pipe.process(.success("")) | ||
wait(for: assertPipe.expectations, timeout: 1.0) | ||
} | ||
|
||
func testPipelineReset() { | ||
|
||
assertPipe.resetExpectation = expectation(description: "reset") | ||
self.pipe.process(.reset) | ||
wait(for: assertPipe.expectations, timeout: 1.0) | ||
} | ||
|
||
func testPipelineFailure() { | ||
|
||
assertPipe.failureExpectation = expectation(description: "failure") | ||
self.pipe.process(.failure(PipelineErrors.requiredFailure)) | ||
wait(for: assertPipe.expectations, timeout: 1.0) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.