Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (24 sloc) 1.226 kB
cc = require '../lib/coffeecup'
assert = require 'assert'
describe 'custom', ->
describe '#tag(name, attr)', ->
it 'should render', ->
t = -> tag 'custom'
assert.equal cc.render(t), '<custom></custom>'
it 'should render with attributes', ->
t = -> tag 'custom', foo: 'bar', ping: 'pong'
assert.equal cc.render(t), '<custom foo="bar" ping="pong"></custom>'
it 'should render with attributes and inner attributes', ->
t = -> tag 'custom', foo: 'bar', ping: 'pong', -> 'zag'
assert.equal cc.render(t), '<custom foo="bar" ping="pong">zag</custom>'
describe 'custom optimized', ->
describe '#tag(name, attr)', ->
it 'should render', ->
t = -> tag 'custom'
assert.equal cc.render(t, optimized: true, cache: on), '<custom></custom>'
it 'should render with attributes', ->
t = -> tag 'custom', foo: 'bar', ping: 'pong'
assert.equal cc.render(t, optimized: true, cache: on), '<custom foo="bar" ping="pong"></custom>'
it 'should render with attributes and inner attributes', ->
t = -> tag 'custom', foo: 'bar', ping: 'pong', -> 'zag'
assert.equal cc.render(t, optimized: true, cache: on), '<custom foo="bar" ping="pong">zag</custom>'
Jump to Line
Something went wrong with that request. Please try again.