public
Description: Liquid markup language. Save, customer facing template language for flexible web apps.
Homepage: http://www.liquidmarkup.org
Clone URL: git://github.com/tobi/liquid.git
Click here to lend your support to: liquid and make a donation at www.pledgie.com !
Emmanuel Oga (author)
Tue Jul 08 08:54:52 -0700 2008
commit  3eddf5fb9e708cf26603d1f535a60e2e5ae0fc65
tree    61f0e314c49a8c47640654dad4049676573812e5
parent  6dd4f716f824b66680976f564cfc85615283fe9e
liquid / test / parsing_quirks_test.rb
100644 41 lines (33 sloc) 1.029 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/helper'
 
class ParsingQuirksTest < Test::Unit::TestCase
  include Liquid
 
  def test_error_with_css
    text = %| div { font-weight: bold; } |
template = Template.parse(text)
assert_equal text, template.render
assert_equal [String], template.root.nodelist.collect {|i| i.class}
end
def test_raise_on_single_close_bracet
assert_raise(SyntaxError) do
Template.parse("text {{method} oh nos!")
end
end
def test_raise_on_label_and_no_close_bracets
assert_raise(SyntaxError) do
Template.parse("TEST {{ ")
end
end
def test_raise_on_label_and_no_close_bracets_percent
assert_raise(SyntaxError) do
Template.parse("TEST {% ")
end
end
def test_error_on_empty_filter
assert_nothing_raised do
Template.parse("{{test |a|b|}}")
Template.parse("{{test}}")
Template.parse("{{|test|}}")
end
end
end