Created
July 28, 2011 20:50
-
-
Save tomdale/1112528 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
testBoth('should fire observer that contains a path', function(get, set) { | |
var CarMixin = SC.Mixin.create({ | |
acceleration: 0 | |
}); | |
var car = SC.mixin({}, CarMixin); | |
var tireAcceleration; | |
var TireMixin = SC.Mixin.create({ | |
accelerationDidChange: SC.observer(function() { | |
tireAcceleration = get(this, 'car.acceleration'); | |
}, 'car.acceleration') | |
}); | |
var tire = SC.mixin({ | |
car: car | |
}, TireMixin); | |
set(car, 'acceleration', 50); | |
equals(tireAcceleration, 50, "observer should fire"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment