diff options
Diffstat (limited to 'docs/spec/domSpec.js')
| -rw-r--r-- | docs/spec/domSpec.js | 24 | 
1 files changed, 24 insertions, 0 deletions
| diff --git a/docs/spec/domSpec.js b/docs/spec/domSpec.js new file mode 100644 index 00000000..af1a8faa --- /dev/null +++ b/docs/spec/domSpec.js @@ -0,0 +1,24 @@ +var DOM = require('dom.js').DOM; + +describe('dom', function(){ +  describe('example', function(){ +    it('should render code, live, test', function(){ +      var dom = new DOM(); +      dom.example('desc', 'src', 'scenario'); +      expect(dom.toString()).toEqual('<h1>Example</h1>\ndesc<doc:example><doc:source>src</doc:source>\n<doc:scenario>scenario</doc:scenario>\n</doc:example>\n'); +    }); + +    it('should render non-live, test with description', function(){ +      var dom = new DOM(); +      dom.example('desc', 'src', false); +      expect(dom.toString()).toEqual('<h1>Example</h1>\ndesc<div ng:non-bindable=""><pre class="brush: js; html-script: true;">src</pre>\n</div>\n'); +    }); + +    it('should render non-live, test', function(){ +      var dom = new DOM(); +      dom.example('desc', 'src', false); +      expect(dom.toString()).toContain('<pre class="brush: js; html-script: true;">src</pre>'); +    }); + +  }); +}); | 
