Skip to content

Commit

Permalink
Merge pull request #61 from iv-mexx/fixTestFails
Browse files Browse the repository at this point in the history
Fix test fails
  • Loading branch information
neilpa committed Nov 12, 2015
2 parents a64d196 + 41d5c22 commit 677d660
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Tests/UIKit/UIButtonTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extension UIButton {
}

override public func sendAction(action: Selector, to target: AnyObject?, forEvent event: UIEvent?) {
target?.performSelector(action)
target?.performSelector(action, withObject: nil)
}
}

Expand Down Expand Up @@ -87,10 +87,11 @@ class UIButtonTests: XCTestCase {
}

passed <~ SignalProducer(signal: action.values)
button.rex_pressed.value = CocoaAction(action, input: ())
button.rex_pressed <~ SignalProducer(value: CocoaAction(action, input: ()))

button.sendActionsForControlEvents(.TouchUpInside)


XCTAssertTrue(passed.value)
}

Expand Down
6 changes: 3 additions & 3 deletions Tests/UIKit/UIViewTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class UIViewTests: XCTestCase {
_view = view

view.rex_alpha <~ SignalProducer(value: 0.5)
XCTAssert(_view?.alpha == 0.5)
XCTAssertEqualWithAccuracy(_view!.alpha, 0.5, accuracy: 0.01)
}

func testHiddenPropertyDoesntCreateRetainCycle() {
Expand Down Expand Up @@ -59,8 +59,8 @@ class UIViewTests: XCTestCase {
view.rex_alpha <~ SignalProducer(signal: pipeSignal)

observer.sendNext(firstChange)
XCTAssertEqual(view.alpha, firstChange)
XCTAssertEqualWithAccuracy(view.alpha, firstChange, accuracy: 0.01)
observer.sendNext(secondChange)
XCTAssertEqual(view.alpha, secondChange)
XCTAssertEqualWithAccuracy(view.alpha, secondChange, accuracy: 0.01)
}
}

0 comments on commit 677d660

Please sign in to comment.