Skip to content

Commit

Permalink
test: reorganize shadowing test
Browse files Browse the repository at this point in the history
  • Loading branch information
nikku committed Dec 21, 2022
1 parent 20d1f0c commit 7323bb4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "UML",
"uri": "http://www.omg.org/spec/UML/20131001",
"prefix": "uml",
"name": "Shadow",
"uri": "http://shadow",
"prefix": "s",
"types": [
{
"name": "Element",
"properties": []
},
{
"name": "NamedElement",
"superClass": [ "uml:Element" ]
"superClass": [ "s:Element" ]
}
]
}
38 changes: 20 additions & 18 deletions test/spec/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Element>', 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 <Element>', function() {

// when
var element = model.create('s:Element');

it('should shadow <Element> 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 <Element> 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;
});

});
Expand Down

0 comments on commit 7323bb4

Please sign in to comment.