Skip to content

Commit 33b4916

Browse files
committed
Merge pull request #36 from rbeeger/singleStatementOperatorUsage
Single statement operator usage
2 parents 53b2200 + 0db8bb0 commit 33b4916

6 files changed

Lines changed: 16 additions & 32 deletions

File tree

Nimble/Matchers/BeGreaterThan.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@ public func beGreaterThan(expectedValue: NMBComparable?) -> MatcherFunc<NMBCompa
1616
}
1717
}
1818

19-
public func ><T: Comparable>(lhs: Expectation<T?>, rhs: T) -> Bool {
19+
public func ><T: Comparable>(lhs: Expectation<T?>, rhs: T) {
2020
lhs.to(beGreaterThan(rhs))
21-
return true
2221
}
2322

24-
public func >(lhs: Expectation<NMBComparable?>, rhs: NMBComparable?) -> Bool {
23+
public func >(lhs: Expectation<NMBComparable?>, rhs: NMBComparable?) {
2524
lhs.to(beGreaterThan(rhs))
26-
return true
2725
}
2826

2927
extension NMBObjCMatcher {

Nimble/Matchers/BeGreaterThanOrEqualTo.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@ public func beGreaterThanOrEqualTo<T: NMBComparable>(expectedValue: T?) -> Match
1717
}
1818
}
1919

20-
public func >=<T: Comparable>(lhs: Expectation<T?>, rhs: T) -> Bool {
20+
public func >=<T: Comparable>(lhs: Expectation<T?>, rhs: T) {
2121
lhs.to(beGreaterThanOrEqualTo(rhs))
22-
return true
2322
}
2423

25-
public func >=<T: NMBComparable>(lhs: Expectation<T?>, rhs: T) -> Bool {
24+
public func >=<T: NMBComparable>(lhs: Expectation<T?>, rhs: T) {
2625
lhs.to(beGreaterThanOrEqualTo(rhs))
27-
return true
2826
}
2927

3028
extension NMBObjCMatcher {

Nimble/Matchers/BeIdenticalTo.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@ public func beIdenticalTo<T: AnyObject>(expected: T?) -> MatcherFunc<T?> {
1414
}
1515
}
1616

17-
public func ===<T: AnyObject>(lhs: Expectation<T?>, rhs: T?) -> Bool {
17+
public func ===<T: AnyObject>(lhs: Expectation<T?>, rhs: T?) {
1818
lhs.to(beIdenticalTo(rhs))
19-
return true
2019
}
21-
public func !==<T: AnyObject>(lhs: Expectation<T?>, rhs: T?) -> Bool {
20+
public func !==<T: AnyObject>(lhs: Expectation<T?>, rhs: T?) {
2221
lhs.toNot(beIdenticalTo(rhs))
23-
return true
2422
}
2523

2624
extension NMBObjCMatcher {

Nimble/Matchers/BeLessThan.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@ public func beLessThan(expectedValue: NMBComparable?) -> MatcherFunc<NMBComparab
1616
}
1717
}
1818

19-
public func <<T: Comparable>(lhs: Expectation<T?>, rhs: T) -> Bool {
19+
public func <<T: Comparable>(lhs: Expectation<T?>, rhs: T) {
2020
lhs.to(beLessThan(rhs))
21-
return true
2221
}
2322

24-
public func <(lhs: Expectation<NMBComparable?>, rhs: NMBComparable?) -> Bool {
23+
public func <(lhs: Expectation<NMBComparable?>, rhs: NMBComparable?) {
2524
lhs.to(beLessThan(rhs))
26-
return true
2725
}
2826

2927
extension NMBObjCMatcher {

Nimble/Matchers/BeLessThanOrEqual.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@ public func beLessThanOrEqualTo<T: NMBComparable>(expectedValue: T?) -> MatcherF
1515
}
1616
}
1717

18-
public func <=<T: Comparable>(lhs: Expectation<T?>, rhs: T) -> Bool {
18+
public func <=<T: Comparable>(lhs: Expectation<T?>, rhs: T) {
1919
lhs.to(beLessThanOrEqualTo(rhs))
20-
return true
2120
}
2221

23-
public func <=<T: NMBComparable>(lhs: Expectation<T?>, rhs: T) -> Bool {
22+
public func <=<T: NMBComparable>(lhs: Expectation<T?>, rhs: T) {
2423
lhs.to(beLessThanOrEqualTo(rhs))
25-
return true
2624
}
2725

2826
extension NMBObjCMatcher {

Nimble/Matchers/Equal.swift

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,34 +58,28 @@ public func equal<T: Equatable>(expectedValue: [T]?) -> MatcherFunc<[T]?> {
5858
}
5959
}
6060

61-
public func ==<T: Equatable>(lhs: Expectation<T?>, rhs: T?) -> Bool {
61+
public func ==<T: Equatable>(lhs: Expectation<T?>, rhs: T?) {
6262
lhs.to(equal(rhs))
63-
return true
6463
}
6564

66-
public func !=<T: Equatable>(lhs: Expectation<T?>, rhs: T?) -> Bool {
65+
public func !=<T: Equatable>(lhs: Expectation<T?>, rhs: T?) {
6766
lhs.toNot(equal(rhs))
68-
return true
6967
}
7068

71-
public func ==<T: Equatable>(lhs: Expectation<[T]?>, rhs: [T]?) -> Bool {
69+
public func ==<T: Equatable>(lhs: Expectation<[T]?>, rhs: [T]?) {
7270
lhs.to(equal(rhs))
73-
return true
7471
}
7572

76-
public func !=<T: Equatable>(lhs: Expectation<[T]?>, rhs: [T]?) -> Bool {
73+
public func !=<T: Equatable>(lhs: Expectation<[T]?>, rhs: [T]?) {
7774
lhs.toNot(equal(rhs))
78-
return true
7975
}
8076

81-
public func ==<T: Equatable, C: Equatable>(lhs: Expectation<[T: C]?>, rhs: [T: C]?) -> Bool {
77+
public func ==<T: Equatable, C: Equatable>(lhs: Expectation<[T: C]?>, rhs: [T: C]?) {
8278
lhs.to(equal(rhs))
83-
return true
8479
}
8580

86-
public func !=<T: Equatable, C: Equatable>(lhs: Expectation<[T: C]?>, rhs: [T: C]?) -> Bool {
81+
public func !=<T: Equatable, C: Equatable>(lhs: Expectation<[T: C]?>, rhs: [T: C]?) {
8782
lhs.toNot(equal(rhs))
88-
return true
8983
}
9084

9185
extension NMBObjCMatcher {

0 commit comments

Comments
 (0)