Skip to content

Commit 1b092fc

Browse files
committed
Fix the test case for TaskEvent.StandardError
1 parent 95cf78c commit 1b092fc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ReactiveTaskTests/TaskSpec.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ class TaskSpec: QuickSpec {
5050
}
5151

5252
it("should launch a task that writes to stderr") {
53+
let aggregated = NSMutableData()
5354
let result = launchTask(Task("/usr/bin/stat", arguments: [ "not-a-real-file" ]))
54-
.reduce(NSMutableData()) { aggregated, event in
55+
.reduce(aggregated) { aggregated, event in
5556
if case let .StandardError(data) = event {
5657
aggregated.appendData(data)
5758
}
@@ -61,9 +62,8 @@ class TaskSpec: QuickSpec {
6162
.single()
6263

6364
expect(result).notTo(beNil())
64-
if let data = result?.value {
65-
expect(NSString(data: data, encoding: NSUTF8StringEncoding)).to(equal("stat: not-a-real-file: stat: No such file or directory\n"))
66-
}
65+
expect(result?.error).notTo(beNil())
66+
expect(NSString(data: aggregated, encoding: NSUTF8StringEncoding)).to(equal("stat: not-a-real-file: stat: No such file or directory\n"))
6767
}
6868

6969
it("should launch a task with standard input") {

0 commit comments

Comments
 (0)