 import RxSugar
 import XCTest
 
-class TestControl: UIControl {
-	var value: String = ""
-	
+protocol TestControl {}
+
+extension TestControl where Self: UIControl {
 	// best approximation of UIControl behavior without running UI tests
-	override func sendActionsForControlEvents(controlEvents: UIControlEvents) {
+	func fireControlEvents(controlEvents: UIControlEvents) {
 		self.allTargets().forEach { target in
 			self.actionsForTarget(target, forControlEvent: controlEvents)?.forEach { action in
 				target.performSelector(NSSelectorFromString(action))

		_ = eventStream.subscribeNext { events.append($0) }
		
		testObject.value = "Major Tom"
		testObject.sendActionsForControlEvents([.TouchDragInside])
		XCTAssertEqual(events, [])
		
		testObject.value = "Ground Control"
		testObject.sendActionsForControlEvents([.ValueChanged])
		XCTAssertEqual(events, ["Ground Control"])
	}
}
		_ = eventStream.subscribeNext { events.append($0) }
		
		testObject.value = "Major Tom"
		testObject.fireControlEvents([.ValueChanged])
		XCTAssertEqual(events, ["Major Tom"])
		
		testObject.value = "Ground Control"
		testObject.fireControlEvents([.TouchDown])
		XCTAssertEqual(events, ["Major Tom", "Ground Control"])
	}
	
	func testControlSendsOnlyEventsSubscribedTo() {
		let testObject = Control()
		let eventStream = testObject.rxs.controlEvents([.ValueChanged]) {
			return $0.value
		}
