fixed up ios plist install
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/3738b462 Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/3738b462 Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/3738b462 Branch: refs/heads/future Commit: 3738b462c1529343add979af4bf98a22cf410d7a Parents: e47bb83 Author: Tim Kim <[email protected]> Authored: Fri Apr 12 15:46:40 2013 -0700 Committer: Tim Kim <[email protected]> Committed: Fri Apr 12 15:46:40 2013 -0700 ---------------------------------------------------------------------- test/ios-plist-install.js | 26 ++++++++++++++++++++------ 1 files changed, 20 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/3738b462/test/ios-plist-install.js ---------------------------------------------------------------------- diff --git a/test/ios-plist-install.js b/test/ios-plist-install.js index 12e0791..4ac8fbd 100644 --- a/test/ios-plist-install.js +++ b/test/ios-plist-install.js @@ -25,7 +25,7 @@ var fs = require('fs') , shell = require('shelljs') , et = require('elementtree') , ios = require(path.join(__dirname, '..', 'platforms', 'ios')) - + , plugin_loader = require('../util/plugin_loader') , test_dir = path.join(osenv.tmpdir(), 'test_plugman') , test_project_dir = path.join(test_dir, 'projects', 'ios-plist') , test_plugin_dir = path.join(test_dir, 'plugins', 'ChildBrowser') @@ -72,9 +72,13 @@ exports['should install webless plugin'] = function (test) { } exports['should move the js file'] = function (test) { + var pluginsPath = path.join(test_dir, 'plugins'); + var wwwPath = path.join(test_dir, 'projects', 'ios-plist', 'www'); + // run the platform-specific function ios.handlePlugin('install', test_project_dir, test_plugin_dir, plugin_et, { APP_ID: 12345 }); - + plugin_loader.handlePrepare(test_project_dir, pluginsPath, wwwPath, 'ios'); + var jsPath = path.join(test_dir, 'projects', 'ios-plist', 'www', 'childbrowser.js'); test.ok(fs.existsSync(jsPath)); test.ok(fs.statSync(jsPath).isFile()); @@ -82,23 +86,33 @@ exports['should move the js file'] = function (test) { } exports['should move the source files'] = function (test) { + var pluginsPath = path.join(test_dir, 'plugins'); + var wwwPath = path.join(test_dir, 'projects', 'ios-plist', 'www'); + var preserveDirPath = path.join(srcDir, 'src', 'ios'); + // run the platform-specific function ios.handlePlugin('install', test_project_dir, test_plugin_dir, plugin_et, { APP_ID: 12345 }); - + plugin_loader.handlePrepare(test_project_dir, pluginsPath, wwwPath, 'ios'); + test.ok(fs.existsSync(srcDir + '/ChildBrowserCommand.m')) test.ok(fs.existsSync(srcDir + '/ChildBrowserViewController.m')) - test.ok(fs.existsSync(srcDir + '/preserveDirs/PreserveDirsTest.m')) + test.ok(fs.existsSync(preserveDirPath + '/preserveDirs/PreserveDirsTest.m')) test.ok(fs.existsSync(srcDir + '/targetDir/TargetDirTest.m')) test.done(); } exports['should move the header files'] = function (test) { + var pluginsPath = path.join(test_dir, 'plugins'); + var wwwPath = path.join(test_dir, 'projects', 'ios-plist', 'www'); + var preserveDirPath = path.join(srcDir, 'src', 'ios'); + // run the platform-specific function ios.handlePlugin('install', test_project_dir, test_plugin_dir, plugin_et, { APP_ID: 12345 }); - + plugin_loader.handlePrepare(test_project_dir, pluginsPath, wwwPath, 'ios'); + test.ok(fs.statSync(srcDir + '/ChildBrowserCommand.h')); test.ok(fs.statSync(srcDir + '/ChildBrowserViewController.h')); - test.ok(fs.statSync(srcDir + '/preserveDirs/PreserveDirsTest.h')); + test.ok(fs.statSync(preserveDirPath + '/preserveDirs/PreserveDirsTest.h')); test.ok(fs.statSync(srcDir + '/targetDir/TargetDirTest.h')); test.done(); }
