Permalink
Browse files

[api][test] name can't start with an underscore.

  • Loading branch information...
blakmatrix committed Mar 15, 2013
1 parent c19102f commit f0c99217949b7e4dcefe02cb9a7268c0c6ac6672
Showing with 5 additions and 5 deletions.
  1. +3 −3 lib/jitsu/package.js
  2. +2 −2 test/lib/package-test.js
View
@@ -542,10 +542,10 @@ package.properties = function (dir) {
name: 'name',
unique: true,
message: 'Application name',
- validator: /^(?!\.)(?!node_modules)(?!favicon.ico)[^\/@\s\+%:\n]+$/,
+ validator: /^(?!\.)(?!_)(?!node_modules)(?!favicon.ico)[^\/@\s\+%:\n]+$/,
warning: 'The application name must follow the rules for npm package names.\n'+
- ' They must not start with a \'.\', contain any whitespace characters\n'+
- ' or any of the following characters(between quotes): "/@+%:". \n'+
+ ' They must not start with a \'.\' or \'_\', contain any whitespace \n'+
+ ' characters or any of the following characters(between quotes): "/@+%:". \n'+
' Additionally, the name may not be \'node_modules\' or \'favicon.ico\'.',
default: path.basename(dir)
},
View
@@ -61,8 +61,8 @@ var suite = vows.describe('jitsu/lib/package').addBatch({
'starting with _': {
topic: setupPackage({ name: '_example-app' }),
- 'should be valid': function (topic) {
- assert.ok(isValid('name', topic.name));
+ 'should be invalid': function (topic) {
+ assert.ok(!isValid('name', topic.name));
}
},
'containing -': {

0 comments on commit f0c9921

Please sign in to comment.