mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 16:48:00 +00:00
27 lines
583 B
JavaScript
27 lines
583 B
JavaScript
|
define(["Tone/instrument/Instrument", "helper/Basic"], function (Instrument, Basic) {
|
||
|
|
||
|
describe("Instrument", function(){
|
||
|
|
||
|
Basic(Instrument);
|
||
|
|
||
|
context("API", function(){
|
||
|
|
||
|
it ("can be constructed with an options object", function(){
|
||
|
var instr = new Instrument({
|
||
|
"volume" : -12
|
||
|
});
|
||
|
expect(instr.volume.value).to.be.closeTo(-12, 0.1);
|
||
|
instr.dispose();
|
||
|
});
|
||
|
|
||
|
it ("can get/set attributes", function(){
|
||
|
var instr = new Instrument();
|
||
|
instr.set({
|
||
|
"volume" : 2
|
||
|
});
|
||
|
expect(instr.get().volume).to.be.closeTo(2, 0.1);
|
||
|
});
|
||
|
|
||
|
});
|
||
|
});
|
||
|
});
|