diff --git a/test/fixtures/model/extension/uml.json b/test/fixtures/model/shadow.json similarity index 50% rename from test/fixtures/model/extension/uml.json rename to test/fixtures/model/shadow.json index 4c992b7..0b69981 100644 --- a/test/fixtures/model/extension/uml.json +++ b/test/fixtures/model/shadow.json @@ -1,7 +1,7 @@ { - "name": "UML", - "uri": "http://www.omg.org/spec/UML/20131001", - "prefix": "uml", + "name": "Shadow", + "uri": "http://shadow", + "prefix": "s", "types": [ { "name": "Element", @@ -9,7 +9,7 @@ }, { "name": "NamedElement", - "superClass": [ "uml:Element" ] + "superClass": [ "s:Element" ] } ] } \ No newline at end of file diff --git a/test/spec/extension.js b/test/spec/extension.js index 1692002..b10f06d 100644 --- a/test/spec/extension.js +++ b/test/spec/extension.js @@ -10,34 +10,36 @@ describe('extension', function() { var createModel = createModelBuilder('test/fixtures/model/'); - describe('built in name shadowing', function() { + describe('types', function() { - it('should shadow ', function() { + describe('built-in shadowing', function() { // given - var model = createModel([ 'extension/uml' ]); + var model = createModel([ 'shadow' ]); - // when - var element = model.create('uml:Element'); - // then - expect(element).to.exist; - expect(element.$instanceOf('uml:Element')).to.be.true; - }); + it('should shadow ', function() { + // when + var element = model.create('s:Element'); - it('should shadow in inheritance hierarchy', function() { + // then + expect(element).to.exist; + expect(element.$instanceOf('s:Element')).to.be.true; + }); - // given - var model = createModel([ 'extension/uml' ]); - // when - var element = model.create('uml:NamedElement'); + it('should shadow in inheritance hierarchy', function() { + + // when + var element = model.create('s:NamedElement'); + + // then + expect(element).to.exist; + expect(element.$instanceOf('s:Element')).to.be.true; + expect(element.$instanceOf('s:NamedElement')).to.be.true; + }); - // then - expect(element).to.exist; - expect(element.$instanceOf('uml:Element')).to.be.true; - expect(element.$instanceOf('uml:NamedElement')).to.be.true; }); });