Sha256: 27742a24262db421fc4a35678778357eb308ab3d91758dd98e438a0b0370c2f4
Contents?: true
Size: 1.55 KB
Versions: 7
Compression:
Stored size: 1.55 KB
Contents
// ========================================================================== // Project: SproutCore - JavaScript Application Framework // Copyright: ©2006-2011 Strobe Inc. and contributors. // Portions ©2008-2010 Apple Inc. All rights reserved. // License: Licensed under MIT license (see license.js) // ========================================================================== /*global module test equals context ok */ var context = null; module("SC.RenderContext#begin", { setup: function() { context = SC.RenderContext(); } }); test("should return a new context with parent context as prevObject", function() { var c2 = context.begin(); ok(c2 !== context, "new context"); equals(c2.prevObject, context, 'previous context'); }); test("should set offset for new context equal to length of previous context", function() { context.push("line1"); var expected = context.length ; var c2 = context.begin(); equals(c2.offset, expected, "offset"); }); test("should copy same strings array to new child context", function() { context.push("line1"); var c2 =context.begin(); equals(c2.strings, context.strings); }); test("should start new context with length of 1 (reserving a space for opening tag)", function() { context.push("line1"); var c2 = context.begin() ; equals(c2.length, 1, 'has empty line'); equals(c2.strings.length, 3, "parent empty line + parent line + empty line"); }); test("should assign passed tag name to new context", function() { var c2 = context.begin('foo'); equals(c2.tagName(), 'foo', 'tag name'); });
Version data entries
7 entries across 7 versions & 2 rubygems