From 04a62e83bcd4067749fa5e2eb0181bc43500169c Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Fri, 6 May 2011 13:29:51 -0700 Subject: Throw error when compiling multiple roots Closes #338 --- test/CompilerSpec.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/CompilerSpec.js') diff --git a/test/CompilerSpec.js b/test/CompilerSpec.js index b9505192..ff576581 100644 --- a/test/CompilerSpec.js +++ b/test/CompilerSpec.js @@ -35,6 +35,15 @@ describe('compiler', function(){ dealoc(scope); }); + it('should not allow compilation of multiple roots', function(){ + expect(function(){ + compiler.compile('
A
'); + }).toThrow("Cannot compile multiple element roots: " + ie("
A
")); + function ie(text) { + return msie ? uppercase(text) : text; + } + }); + it('should recognize a directive', function(){ var e = jqLite('
'); directives.directive = function(expression, element){ -- cgit v1.2.3