Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Add a little spy on creator that defaults to return this to support jQuery-like chaining.
buttonifyAndHide = function($obj) {
$obj.button().hide();
};
var $thing;
beforeEach(function(){
spyOnAndChain($.fn,'button');
$thing = $.jasmine.inject('<div></div>'); //See: https://github.com/searls/jasmine-fixture
buttonifyAndHide($thing);
});
it('calls button',function(){
expect($.fn.button).toHaveBeenCalled();
});
it('is hidden',function(){
expect($thing).not.toBeVisible();
});
(function(){
window.spyOnAndChain = function(obj,method){
spyOn(obj,method).andCallFake(function(){
return this;
});
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.