Skip to content

Commit

Permalink
[test] npm test passes, [doc] updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Paolo Fragomeni committed Jan 31, 2012
1 parent f994de5 commit 29efc75
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 69 deletions.
Binary file added .DS_Store
Binary file not shown.
18 changes: 14 additions & 4 deletions test/extraction-test.js
Expand Up @@ -5,12 +5,22 @@ var vm = require('vm');

module.exports = extraction({

setUp: function (callback) {
callback();
setUp: function (test) {
if (typeof test === 'function') {
test();
}
else {
test.done();
}
},

tearDown: function (callback) {
callback();
tearDown: function (test) {
if (typeof test === 'function') {
test();
}
else {
test.done();
}
},

'1. Extract a method by `simple` name.': function (test) {
Expand Down
22 changes: 21 additions & 1 deletion test/output/write-test-output-0.2.2.js
@@ -1,10 +1,30 @@


//
// Generated on Tue Jan 31 2012 05:38:29 GMT-0500 (EST) by Nodejitsu Inc <info@nodejitsu.com>
// Generated on Tue Jan 31 2012 05:51:43 GMT-0500 (EST) by Nodejitsu Inc <info@nodejitsu.com>
// Version 0.2.2
//
function test5() {
return true;
}



//
// Generated on Tue Jan 31 2012 05:51:43 GMT-0500 (EST) by Nodejitsu Inc <info@nodejitsu.com>
// Version 0.2.2
//
var test6 = function() {
return String(Date.now());
};



//
// Generated on Tue Jan 31 2012 05:51:43 GMT-0500 (EST) by Nodejitsu Inc <info@nodejitsu.com>
// Version 0.2.2
//
var test10 = function() {
return "test10";
}();

2 changes: 1 addition & 1 deletion test/output/write-test-output-broad-0.2.2.js
@@ -1,7 +1,7 @@


//
// Generated on Tue Jan 31 2012 05:38:30 GMT-0500 (EST) by Nodejitsu Inc <info@nodejitsu.com>
// Generated on Tue Jan 31 2012 05:51:43 GMT-0500 (EST) by Nodejitsu Inc <info@nodejitsu.com>
// Version 0.2.2
//

Expand Down
2 changes: 1 addition & 1 deletion test/output/write-test-output-uglifyd-0.2.2.js
@@ -1,7 +1,7 @@


//
// Generated on Tue Jan 31 2012 05:38:30 GMT-0500 (EST) by Nodejitsu Inc <info@nodejitsu.com>
// Generated on Tue Jan 31 2012 05:51:43 GMT-0500 (EST) by Nodejitsu Inc <info@nodejitsu.com>
// Version 0.2.2
//
function test5(){return!0}
2 changes: 1 addition & 1 deletion test/output/write-test-output-wrap-0.2.2.js
@@ -1,7 +1,7 @@


//
// Generated on Tue Jan 31 2012 05:38:29 GMT-0500 (EST) by Nodejitsu Inc <info@nodejitsu.com>
// Generated on Tue Jan 31 2012 05:51:43 GMT-0500 (EST) by Nodejitsu Inc <info@nodejitsu.com>
// Version 0.2.2
//

Expand Down
18 changes: 14 additions & 4 deletions test/validation-test.js
Expand Up @@ -5,12 +5,22 @@ var fs = require('fs');

module.exports = write({

setUp: function (callback) {
callback();
setUp: function (test) {
if (typeof test === 'function') {
test();
}
else {
test.done();
}
},

tearDown: function (callback) {
callback();
tearDown: function (test) {
if (typeof test === 'function') {
test();
}
else {
test.done();
}
},

'1. Lint fail (intentionally).': function (test) {
Expand Down
22 changes: 16 additions & 6 deletions test/write-test.js
Expand Up @@ -5,12 +5,22 @@ var fs = require('fs');

module.exports = write({

setUp: function (callback) {
callback();
setUp: function (test) {
if (typeof test === 'function') {
test();
}
else {
test.done();
}
},

tearDown: function (callback) {
callback();
tearDown: function (test) {
if (typeof test === 'function') {
test();
}
else {
test.done();
}
},

'1. Extract a method by `simple` name and write the contents to a new file.': function (test) {
Expand Down Expand Up @@ -76,7 +86,7 @@ module.exports = write({
})
.read(__dirname + '/fixture1.js')
.extract('test6')
.append('write-test-output.js')
.append(__dirname + '/output/write-test-output.js')
;

var file = fs.readFileSync(surgeon.newfile, 'utf8');
Expand All @@ -102,7 +112,7 @@ module.exports = write({
})
.read(__dirname + '/fixture1.js')
.extract('test10')
.append('write-test-output.js', function() {
.append(__dirname + '/output/write-test-output.js', function() {

var file = fs.readFileSync(this.newfile, 'utf8');
vm.runInNewContext(file, sandbox, 'sandbox.vm');
Expand Down
52 changes: 1 addition & 51 deletions write-test-output-0.2.2.js
@@ -1,57 +1,7 @@


//
// Generated on Tue Jan 31 2012 05:35:42 GMT-0500 (EST) by Nodejitsu Inc <info@nodejitsu.com>
// Version 0.2.2
//
var test6 = function() {
return String(Date.now());
};



//
// Generated on Tue Jan 31 2012 05:35:42 GMT-0500 (EST) by Nodejitsu Inc <info@nodejitsu.com>
// Version 0.2.2
//
var test10 = function() {
return "test10";
}();



//
// Generated on Tue Jan 31 2012 05:37:09 GMT-0500 (EST) by Nodejitsu Inc <info@nodejitsu.com>
// Version 0.2.2
//
var test6 = function() {
return String(Date.now());
};



//
// Generated on Tue Jan 31 2012 05:37:09 GMT-0500 (EST) by Nodejitsu Inc <info@nodejitsu.com>
// Version 0.2.2
//
var test10 = function() {
return "test10";
}();



//
// Generated on Tue Jan 31 2012 05:38:29 GMT-0500 (EST) by Nodejitsu Inc <info@nodejitsu.com>
// Version 0.2.2
//
var test6 = function() {
return String(Date.now());
};



//
// Generated on Tue Jan 31 2012 05:38:30 GMT-0500 (EST) by Nodejitsu Inc <info@nodejitsu.com>
// Generated on Tue Jan 31 2012 05:42:15 GMT-0500 (EST) by Nodejitsu Inc <info@nodejitsu.com>
// Version 0.2.2
//
var test10 = function() {
Expand Down

0 comments on commit 29efc75

Please sign in to comment.