Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop-perf' into develop-perf
Browse files Browse the repository at this point in the history
  • Loading branch information
mojit0 committed Oct 11, 2012
2 parents f4e4bcc + fe79b9a commit 201857e
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions tests/unit/lib/app/addons/ac/test-deploy.server.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ YUI().use('mojito-deploy-addon', 'test', 'json-parse', function(Y) {
},


'YUI_config should use application.json yui.config': function() {
'YUI.applyConfig() should use application.json yui.config': function() {
addon.ac = {
http: {
getHeader: function(h) {
Expand Down Expand Up @@ -82,11 +82,11 @@ YUI().use('mojito-deploy-addon', 'test', 'json-parse', function(Y) {
addon.constructMojitoClientRuntime(assetHandler, binderMap);

A.areSame(1, blobs.length, 'wrong number of blobs');
var matches = blobs[0].match(/YUI_config = (.+?);/);
A.isNotUndefined(matches[1], 'failed to find YUI_config in blob');
var matches = blobs[0].match(/YUI\.applyConfig\((.+?)\);/);
A.isNotUndefined(matches[1], 'failed to find YUI.applyConfig() in blob');
var config = Y.JSON.parse(matches[1]);
A.isObject(config, 'failed to parse YUI_config');
A.areSame('bar', config.foo, 'failed to base YUI_config on application.yui.config');
A.isObject(config, 'failed to parse YUI.applyConfig()');
A.areSame('bar', config.foo, 'failed to base YUI.applyConfig() on application.yui.config');
A.areSame('klingon', config.lang, 'wrong lang used');
},

Expand Down Expand Up @@ -157,11 +157,7 @@ YUI().use('mojito-deploy-addon', 'test', 'json-parse', function(Y) {

var expected = [
'<script type="text/javascript">',
' YUI_config = {"foo":"bar","lang":"klingon","base":"combo?","combine":true};',
' YUI.Env.core.push("loader-base"); // workaround (ticket 2532571)',
' YUI_config.bootstrap = true;',
' YUI_config.comboBase = "/combo?";',
' YUI_config.combine = true;',
' YUI.applyConfig({"foo":"bar","lang":"klingon","combine":true,"comboBase":"/combo?","root":""});',
' YUI().use(\'mojito-client\', function(Y) {',
' window.YMojito = { client: new Y.mojito.Client({"context":{"lang":"klingon","runtime":"client"},"binderMap":{"viewId1":{"needs":"a drink"},"viewId2":{"needs":"another drink"}},"routes":["routes"]}) };',
' });',
Expand All @@ -172,11 +168,11 @@ YUI().use('mojito-deploy-addon', 'test', 'json-parse', function(Y) {
A.isArray(blobs);
A.areSame(expected, blobs[0]);
A.areSame(1, blobs.length, 'wrong number of blobs');
var matches = blobs[0].match(/YUI_config = (.+?);/);
A.isNotUndefined(matches[1], 'failed to find YUI_config in blob');
var matches = blobs[0].match(/YUI\.applyConfig\((.+?)\);/);
A.isNotUndefined(matches[1], 'failed to find YUI.applyConfig() in blob');
var config = Y.JSON.parse(matches[1]);
A.isObject(config, 'failed to parse YUI_config');
A.areSame('bar', config.foo, 'failed to base YUI_config on application.yui.config');
A.isObject(config, 'failed to parse YUI.applyConfig()');
A.areSame('bar', config.foo, 'failed to base YUI.applyConfig() on application.yui.config');
A.areSame('klingon', config.lang, 'wrong lang used');
},

Expand Down

0 comments on commit 201857e

Please sign in to comment.