Skip to content

Commit

Permalink
Rename UnboxError.InvalidValueErrors -> InvalidValues
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnSundell committed May 23, 2016
1 parent acff2fe commit e0921d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Sources/Unbox.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public enum UnboxError: ErrorType, CustomStringConvertible {
let baseDescription = "[Unbox error] "

switch self {
case .InvalidValueErrors(let errors):
case .InvalidValues(let errors):
return baseDescription + errors.map{"\($0)"}.joinWithSeparator(", ")
case .InvalidData:
return baseDescription + "Invalid NSData"
Expand All @@ -118,8 +118,8 @@ public enum UnboxError: ErrorType, CustomStringConvertible {
}
}

/// Thrown when one or many invalid value errors were encountered. See UnboxValueError for more info.
case InvalidValueErrors([UnboxValueError])
/// Thrown when one or many invalid values were encountered. Contains errors for each value. See UnboxValueError for more info.
case InvalidValues([UnboxValueError])
/// Thrown when a piece of data (NSData) could not be unboxed because it was considered invalid
case InvalidData
/// Thrown when a custom unboxing closure returned nil
Expand Down Expand Up @@ -738,7 +738,7 @@ private extension Unboxer {
}
}

throw UnboxError.InvalidValueErrors(inputErrors)
throw UnboxError.InvalidValues(inputErrors)
}
}

Expand Down
4 changes: 2 additions & 2 deletions Tests/UnboxTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ class UnboxTests: XCTestCase {
do {
try Unbox(invalidDictionary) as UnboxTestMock
XCTFail("Unbox should have thrown for a missing value")
} catch UnboxError.InvalidValueErrors(let errors) where !errors.isEmpty {
} catch UnboxError.InvalidValues(let errors) where !errors.isEmpty {
guard case .MissingValueForKey(_) = errors.first! else {
XCTFail("Unbox did not return the correct error type")
return
Expand All @@ -510,7 +510,7 @@ class UnboxTests: XCTestCase {
do {
try Unbox(invalidDictionary) as UnboxTestMock
XCTFail("Unbox should have thrown for an invalid value")
} catch UnboxError.InvalidValueErrors(let errors) where !errors.isEmpty {
} catch UnboxError.InvalidValues(let errors) where !errors.isEmpty {
guard case .InvalidValue(_, _) = errors.first! else {
XCTFail("Unbox did not return the correct error type")
return
Expand Down

0 comments on commit e0921d8

Please sign in to comment.