Skip to content

Commit

Permalink
Add test for a init funcionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kami committed Mar 26, 2011
1 parent b9419af commit 7692e88
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
22 changes: 22 additions & 0 deletions example/init.js
@@ -0,0 +1,22 @@
/*
* Licensed to Cloudkick, Inc ('Cloudkick') under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* Cloudkick licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

var fs = require('fs');

exports['init'] = function() {
fs.mkdirSync('../example/test-123456', 0655);
};
16 changes: 16 additions & 0 deletions test/simple.sh 100644 → 100755
Expand Up @@ -60,4 +60,20 @@ if [ ! $? -gt 0 ]; then
exit 1
fi

# Test init file
FOLDER_EXISTS=0
rm -rf ${CWD}/example/test-123456
${CWD}/bin/whiskey --init-file "${CWD}/example/init.js" --tests "${CWD}/example/test-success.js"

if [ -d ${CWD}/example/test-123456 ]; then
FOLDER_EXISTS=1
fi

rm -rf ${CWD}/example/test-123456

if [ $? -ne 0 ] || [ ${FOLDER_EXISTS} -ne 1 ]; then
echo "Test should pass but failed."
exit 1
fi

exit 0

0 comments on commit 7692e88

Please sign in to comment.