diff options
| author | Misko Hevery | 2011-05-06 13:29:51 -0700 | 
|---|---|---|
| committer | Misko Hevery | 2011-06-08 15:21:33 -0700 | 
| commit | 04a62e83bcd4067749fa5e2eb0181bc43500169c (patch) | |
| tree | f8cd732f1ed44bd18308c4393c893e39190e9735 /test/CompilerSpec.js | |
| parent | f9f95879f08073ce1170a471a925541324a0ff23 (diff) | |
| download | angular.js-04a62e83bcd4067749fa5e2eb0181bc43500169c.tar.bz2 | |
Throw error when compiling multiple roots
Closes #338
Diffstat (limited to 'test/CompilerSpec.js')
| -rw-r--r-- | test/CompilerSpec.js | 9 | 
1 files changed, 9 insertions, 0 deletions
| 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('<div>A</div><span></span>'); +    }).toThrow("Cannot compile multiple element roots: " + ie("<div>A</div><span></span>")); +    function ie(text) { +      return msie ? uppercase(text) : text; +    } +  }); +    it('should recognize a directive', function(){      var e = jqLite('<div directive="expr" ignore="me"></div>');      directives.directive = function(expression, element){ | 
