Skip to content

Commit

Permalink
Added equivalent proto assignment spec for ko.subscribable
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveSanderson committed Dec 11, 2013
1 parent 85ccad4 commit b6ae46c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec/subscribableBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,23 @@ describe('Subscribable', function() {
expect(instance.customProp).toEqual('some value');
expect(instance.customFunc()).toEqual(instance);
});

it('Should have access to functions added to "fn" on existing instances on supported browsers', function () {
// On unsupported browsers, there's nothing to test
if (!jasmine.browserSupportsProtoAssignment) {
return;
}

this.after(function() {
delete ko.subscribable.fn.customFunction;
});

var subscribable = new ko.subscribable();

var customFunction = function () {};

ko.subscribable.fn.customFunction = customFunction;

expect(subscribable.customFunction).toBe(customFunction);
});
});

0 comments on commit b6ae46c

Please sign in to comment.