Permalink
Browse files

Add test case for #32.

  • Loading branch information...
rubenv committed Feb 27, 2014
1 parent 70d3754 commit e351ba25e780c6a2e8a2e0a76158cbb528e216c2
Showing with 16 additions and 0 deletions.
  1. +1 −0 Gruntfile.coffee
  2. +12 −0 test/extract.coffee
  3. +3 −0 test/fixtures/tapestry.tml
View
@@ -46,6 +46,7 @@ module.exports = (grunt) ->
'tmp/test14.pot': 'test/fixtures/concat.js'
'tmp/test15.pot': 'test/fixtures/data.html'
'tmp/test19.pot': 'test/fixtures/no_delimiter.html'
+ 'tmp/test21.pot': 'test/fixtures/tapestry.tml'
manual:
files:
'tmp/test5.pot': 'test/fixtures/corrupt.html'
View
@@ -267,3 +267,15 @@ describe 'Extract', ->
assert.equal(catalog.items[0].references.length, 1)
assert.equal(catalog.items[0].references[0], 'test/fixtures/custom_marker_name.js')
done()
+
+ it 'Can extract tapestry files', (done) ->
+ assert(fs.existsSync('tmp/test21.pot'))
+
+ po.load 'tmp/test21.pot', (err, catalog) ->
+ assert.equal(err, null)
+ assert.equal(catalog.items.length, 1)
+ assert.equal(catalog.items[0].msgid, 'Bonjour from HelloWorld component.')
+ assert.equal(catalog.items[0].msgstr, '')
+ assert.equal(catalog.items[0].references.length, 1)
+ assert.equal(catalog.items[0].references[0], 'test/fixtures/tapestry.tml')
+ done()
@@ -0,0 +1,3 @@
+<html t:type="layout" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
+ <h1 translate>Bonjour from HelloWorld component.</h1>
+</html>

0 comments on commit e351ba2

Please sign in to comment.