Skip to content

Commit

Permalink
Reference version 4.0.4 since it is what Starscream kept in podspec (#62
Browse files Browse the repository at this point in the history
)

* Reference version 4.0.4 since it is what Starscream kept in podspec

* Fix "(redundantInit) Remove explicit init if not required."
  • Loading branch information
bgoncal committed Apr 18, 2024
1 parent 0791eee commit 8c708b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion HAKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Pod::Spec.new do |s|

s.subspec 'Core' do |subspec|
subspec.source_files = 'Source/**/*.swift'
subspec.dependency 'Starscream', '~> 4.0.8'
subspec.dependency 'Starscream', '~> 4.0.4'
end

s.subspec 'PromiseKit' do |subspec|
Expand Down
6 changes: 3 additions & 3 deletions Tests/HADataDecodable.test.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ internal class HADataDecodableTests: XCTestCase {

func testArrayDecodableSuccess() throws {
let data = HAData.array([.empty, .empty, .empty])
let result = try [RandomDecodable].init(data: data)
let result = try [RandomDecodable](data: data)
XCTAssertEqual(result.count, 3)
}

func testArrayDecodableFailureDueToRootData() {
let data = HAData.dictionary(["key": "value"])
XCTAssertThrowsError(try [RandomDecodable].init(data: data)) { error in
XCTAssertThrowsError(try [RandomDecodable](data: data)) { error in
XCTAssertEqual(error as? HADataError, .couldntTransform(key: "root"))
}
}

func testArrayDecodableFailureDueToInside() throws {
RandomDecodable.shouldThrow = true
let data = HAData.array([.empty, .empty, .empty])
XCTAssertThrowsError(try [RandomDecodable].init(data: data)) { error in
XCTAssertThrowsError(try [RandomDecodable](data: data)) { error in
XCTAssertEqual(error as? HADataError, .missingKey("any"))
}
}
Expand Down

0 comments on commit 8c708b0

Please sign in to comment.