Skip to content

Commit

Permalink
Check uniqueness (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBuchholz committed Sep 8, 2018
1 parent ea51456 commit 7a018af
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/attributes/attributeforinstanceof.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,21 @@ describe("attributes/attributeforinstanceof", function () {
assert(exceptionCaught instanceof gpf.Error.ClassAttributeOnly);
});

it("can't be used twice", function () {
var exceptionCaught;
try {
gpf.define({
$class: "Attribute",
$extend: gpf.attributes.Attribute,
$attributes: [onInstanceOfA, onInstanceOfA],
test: function () {}
});
} catch (e) {
exceptionCaught = e;
}
assert(exceptionCaught instanceof gpf.Error.UniqueAttributeUsedTwice);
});

describe("When used properly", function () {

var AttributeForA,
Expand Down

0 comments on commit 7a018af

Please sign in to comment.