Permalink
Browse files

rm path function from mojito-test module, use const

  • Loading branch information...
isao committed Sep 6, 2012
1 parent 19a01c1 commit 2bc38ede79d7194456225bff93e58bbea5ce734d
View
@@ -179,17 +179,6 @@ YUI.add('mojito-test', function(Y, NAME) {
return mock;
}
- /**
- * Get the full path to something, given it's path relative to the mojito
- * repo directory
- * @method {projpath}
- * @param {string} relpath relative to repo base directory
- * @return {string} absolute filesystem path
- */
- Y.mojito.projpath = function (relpath) {
- return require('path').resolve(__dirname, '../../' + relpath);
- };
-
Y.mojito.MockActionContext = MockActionContext;
Y.mojito.EasyMock = EasyMock;
@@ -198,3 +187,9 @@ YUI.add('mojito-test', function(Y, NAME) {
"node",
"node-event-simulate"
]});
+
+
+YUI.add('mojito-test-extra', function(Y, NAME) {
+ Y.MOJITO_DIR = require ?
+ require('path').resolve(__dirname, '../../') + '/' : null;
+});
@@ -3,13 +3,15 @@
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
-YUI().use('mojito-test', 'test', function(Y) {
+YUI().use('mojito-test-extra', 'test', function(Y) {
var A = Y.Assert,
AA = Y.ArrayAssert,
OA = Y.ObjectAssert,
cases = {},
- factory = require(Y.mojito.projpath('lib/app/middleware/mojito-contextualizer.js')),
+ factory = require(Y.MOJITO_DIR +
+ 'lib/app/middleware/mojito-contextualizer.js'),
+
handler,
req,
res,
@@ -3,13 +3,13 @@
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
-YUI().use('mojito-test', 'test', function(Y) {
+YUI().use('mojito-test-extra', 'test', function(Y) {
var A = Y.Assert,
AA = Y.ArrayAssert,
OA = Y.ObjectAssert,
cases = {},
- factory = require(Y.mojito.projpath('lib/app/middleware/mojito-handler-tunnel')),
+ factory = require(Y.MOJITO_DIR + 'lib/app/middleware/mojito-handler-tunnel'),
expandedContext;
cases = {
@@ -3,13 +3,13 @@
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
-YUI().use('mojito-route-maker', 'mojito-test', 'test', function(Y) {
+YUI().use('mojito-route-maker', 'mojito-test-extra', 'test', function(Y) {
var A = Y.Assert,
AA = Y.ArrayAssert,
OA = Y.ObjectAssert,
cases = {},
- factory = require(Y.mojito.projpath('lib/app/middleware/mojito-router'));
+ factory = require(Y.MOJITO_DIR + 'lib/app/middleware/mojito-router');
cases = {
name: 'Handler route matching',

0 comments on commit 2bc38ed

Please sign in to comment.