Skip to content

Commit

Permalink
Remove useless params (#311)
Browse files Browse the repository at this point in the history
lucas34 authored May 26, 2020
1 parent 9d69ab4 commit b96454d
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Sources/SwiftQueue/JobBuilder.swift
Original file line number Diff line number Diff line change
@@ -141,9 +141,9 @@ public final class JobBuilder {
return self
}

/// Set to `true` if the job can only run when the device is charging
public func requireCharging(value: Bool) -> Self {
info.requireCharging = value
/// Call if the job can only run when the device is charging
public func requireCharging() -> Self {
info.requireCharging = true
return self
}

2 changes: 1 addition & 1 deletion Tests/SwiftQueueTests/ConstraintTests.swift
Original file line number Diff line number Diff line change
@@ -293,7 +293,7 @@ class ConstraintTests: XCTestCase {

let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).build()
JobBuilder(type: type)
.requireCharging(value: true)
.requireCharging()
.schedule(manager: manager)

job.awaitForRemoval()
2 changes: 1 addition & 1 deletion Tests/SwiftQueueTests/SwiftQueueBuilderTests.swift
Original file line number Diff line number Diff line change
@@ -212,7 +212,7 @@ class SwiftQueueBuilderTests: XCTestCase {

let type = UUID().uuidString

let jobInfo = try toJobInfo(serializer, type: type, JobBuilder(type: type).requireCharging(value: true))
let jobInfo = try toJobInfo(serializer, type: type, JobBuilder(type: type).requireCharging())
XCTAssertEqual(jobInfo?.requireCharging, true)
}
}

0 comments on commit b96454d

Please sign in to comment.