-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b4590cd
commit 4db6411
Showing
3 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import Iridium = require('../index'); | ||
|
||
describe("Plugins",() => { | ||
var core = new Iridium.Core({ database: 'test' }); | ||
|
||
it("should be registered with an Iridium Core",() => { | ||
core.register({ | ||
newModel: (model) => { | ||
|
||
}, | ||
newInstance: (instance, model) => { | ||
|
||
}, | ||
validate: [] | ||
}); | ||
}); | ||
|
||
describe("newModel",() => { | ||
it("should allow a plugin to define a handler",() => { | ||
core.register({ | ||
newModel: (model) => { | ||
model.collectionName = 'changed'; | ||
}, | ||
newInstance: (instance, model) => { }, | ||
validate: [] | ||
}); | ||
}); | ||
it("should allow a plugin not to define a handler",() => { | ||
core.register({ | ||
newInstance: (instance, model) => { }, | ||
validate: [] | ||
}); | ||
}); | ||
it("should be called when a new model is created",() => { | ||
var model = new Iridium.Model(core,() => { }, 'test', {}); | ||
chai.expect(model.collectionName).to.exist.and.equal('changed'); | ||
}); | ||
}); | ||
|
||
describe("newInstance",() => { | ||
it("should allow a plugin not to define a handler"); | ||
it("should be called when a new instance is created"); | ||
}); | ||
|
||
describe("validators",() => { | ||
it("should make schema validators available for models"); | ||
it("should allow a plugin to not define any schema validators"); | ||
}); | ||
}); |