Skip to content

Commit

Permalink
Add test stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
mixu committed Jun 27, 2012
1 parent 93c6a7f commit aea4249
Show file tree
Hide file tree
Showing 9 changed files with 202 additions and 3 deletions.
9 changes: 9 additions & 0 deletions lib2/monitor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function Monitor() {
this.width =
this.height =
this.x =
this.y =

}

module.exports = Monitor;
5 changes: 5 additions & 0 deletions lib2/nwm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function Nwm() {

}

module.exports = Nwm;
55 changes: 55 additions & 0 deletions lib2/test/monitor.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
var assert = require('assert'),

Monitor = require('../monitor.js');

exports['given a monitor'] = {

before: function(done) {
this.m = new Monitor();
done();
},

'can get and set x y width height': function(done) {
done();
},

'has a default workspace': function(done) {
done();
},

'can receive keyboard events': function(done) {
done();
},

'on keyboard event, can go to a new workspace by index': function(done) {
done();
},

'on keyboard event, can cycle the layout in the current workspace': function(done) {
done();
},

'can add a new window to the current workspace': function(done) {
done();
},

'on keyboard event, move the current window to a different workspace': function(done) {
done();
},

'when a window requests fullscreen, activates the built-in monocle mode temporarily': function(done) {

},

'when the window that requested fullscreen is removed or requests normal size, returns to the previous layout': function(done) {

}

};

// if this module is the script being run, then run the tests:
if (module == require.main) {
var mocha = require('child_process').spawn('mocha', [ '--colors', '--ui', 'exports', '--reporter', 'spec', __filename ]);
mocha.stdout.pipe(process.stdout);
mocha.stderr.pipe(process.stderr);
}
50 changes: 50 additions & 0 deletions lib2/test/nwm.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
var assert = require('assert'),

Nwm = require('../nwm.js');

exports['given a window manager'] = {

before: function(done) {
this.n = new Nwm();
done();
},

'can add keyboard shortcuts': function(done) {
done();
},

'can add layouts': function(done) {
done();
},

'can add, update and remove monitors': function(done) {
done();
},

'can add, update and remove windows': function(done) {
done();
},

'can add and remove a floating window': function(done) {
done();
},

'events about windows that do not exist or are floating are ignored': function(done) {
done();
},

'when a enternotify occurs, can update the selected window and monitor': function(done) {
done();
}

// the rearrange event should be removed


};

// if this module is the script being run, then run the tests:
if (module == require.main) {
var mocha = require('child_process').spawn('mocha', [ '--colors', '--ui', 'exports', '--reporter', 'spec', __filename ]);
mocha.stdout.pipe(process.stdout);
mocha.stderr.pipe(process.stderr);
}
36 changes: 36 additions & 0 deletions lib2/test/window.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
var assert = require('assert'),

Window = require('../window.js');

exports['given a window'] = {

before: function(done) {
this.w = new Window();
done();
},

'can get and set width height x y': function(done){
done();
},

'can get and set title instance klass': function(done) {
done();
},


'can get and set visible': function(done) {

},

'can apply pending changes': function(done) {

}

};

// if this module is the script being run, then run the tests:
if (module == require.main) {
var mocha = require('child_process').spawn('mocha', [ '--colors', '--ui', 'exports', '--reporter', 'spec', __filename ]);
mocha.stdout.pipe(process.stdout);
mocha.stderr.pipe(process.stderr);
}
27 changes: 27 additions & 0 deletions lib2/test/workspace.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
var assert = require('assert'),

Workspace = require('../workspace.js');

exports['given a workspace'] = {

before: function(done) {
this.w = new Workspace();
done();
},

'can receive add window and remove window events': function(done) {
done();
},

'can call rearrange()': function(done){
done();
}

};

// if this module is the script being run, then run the tests:
if (module == require.main) {
var mocha = require('child_process').spawn('mocha', [ '--colors', '--ui', 'exports', '--reporter', 'spec', __filename ]);
mocha.stdout.pipe(process.stdout);
mocha.stderr.pipe(process.stderr);
}
5 changes: 5 additions & 0 deletions lib2/window.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function Window() {

}

module.exports = Window;
5 changes: 5 additions & 0 deletions lib2/workspace.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function Workspace() {

}

module.exports = Workspace;
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@
"name": "Mikito Takada",
"email": "mixu@mixu.net",
"url": "http://blog.mixu.net/"
},
"keywords": ["nwm", "window manager", "X11"],
},
"keywords": [
"nwm",
"window manager",
"X11"
],
"repository": "git://github.com/mixu/nwm",
"main": "index.js"
"main": "index.js",
"devDependencies": {
"mocha": "~1.2.1"
}
}

0 comments on commit aea4249

Please sign in to comment.