Skip to content

Commit

Permalink
Test for tilt
Browse files Browse the repository at this point in the history
  • Loading branch information
timdream committed Feb 1, 2014
1 parent cd87854 commit 5731432
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions test/tilt.js
@@ -0,0 +1,40 @@
var Kinect = require('..');
var assert = require('assert');

describe("Tilt", function() {

var context;

beforeEach(function() {
context = Kinect();
});

afterEach(function() {
context.close();
});

it("should throw when no angle is specified", function() {
assert.throws(function() {
context.tilt();
});
});

[-15,
-12,
-9,
-3,
0,
3,
8,
12,
0
].forEach(function(angle) {
it("to " + angle, function(done) {
this.timeout(5000);
context.tilt(angle);
console.log('Should be ' + angle + '...');
setTimeout(done, 2000);
});
});

});

0 comments on commit 5731432

Please sign in to comment.