mirror of
https://github.com/kemko/liquid.git
synced 2026-01-06 10:15:40 +03:00
Remove trailing whitespace.
This commit is contained in:
@@ -8,7 +8,7 @@ class VariableTest < Test::Unit::TestCase
|
||||
var = Variable.new('hello')
|
||||
assert_equal 'hello', var.name
|
||||
end
|
||||
|
||||
|
||||
def test_filters
|
||||
var = Variable.new('hello | textileze')
|
||||
assert_equal 'hello', var.name
|
||||
@@ -25,15 +25,15 @@ class VariableTest < Test::Unit::TestCase
|
||||
var = Variable.new(%! 'typo' | link_to: 'Typo', true !)
|
||||
assert_equal %!'typo'!, var.name
|
||||
assert_equal [[:link_to,["'Typo'", "true"]]], var.filters
|
||||
|
||||
|
||||
var = Variable.new(%! 'typo' | link_to: 'Typo', false !)
|
||||
assert_equal %!'typo'!, var.name
|
||||
assert_equal [[:link_to,["'Typo'", "false"]]], var.filters
|
||||
|
||||
|
||||
var = Variable.new(%! 'foo' | repeat: 3 !)
|
||||
assert_equal %!'foo'!, var.name
|
||||
assert_equal [[:repeat,["3"]]], var.filters
|
||||
|
||||
|
||||
var = Variable.new(%! 'foo' | repeat: 3, 3 !)
|
||||
assert_equal %!'foo'!, var.name
|
||||
assert_equal [[:repeat,["3","3"]]], var.filters
|
||||
@@ -45,20 +45,20 @@ class VariableTest < Test::Unit::TestCase
|
||||
var = Variable.new(%! hello | strftime: '%Y, okay?'!)
|
||||
assert_equal 'hello', var.name
|
||||
assert_equal [[:strftime,["'%Y, okay?'"]]], var.filters
|
||||
|
||||
|
||||
var = Variable.new(%! hello | things: "%Y, okay?", 'the other one'!)
|
||||
assert_equal 'hello', var.name
|
||||
assert_equal [[:things,["\"%Y, okay?\"","'the other one'"]]], var.filters
|
||||
end
|
||||
|
||||
|
||||
def test_filter_with_date_parameter
|
||||
|
||||
var = Variable.new(%! '2006-06-06' | date: "%m/%d/%Y"!)
|
||||
assert_equal "'2006-06-06'", var.name
|
||||
assert_equal [[:date,["\"%m/%d/%Y\""]]], var.filters
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
def test_filters_without_whitespace
|
||||
var = Variable.new('hello | textileze | paragraph')
|
||||
assert_equal 'hello', var.name
|
||||
@@ -68,11 +68,11 @@ class VariableTest < Test::Unit::TestCase
|
||||
assert_equal 'hello', var.name
|
||||
assert_equal [[:textileze,[]], [:paragraph,[]]], var.filters
|
||||
end
|
||||
|
||||
|
||||
def test_symbol
|
||||
var = Variable.new("http://disney.com/logo.gif | image: 'med' ")
|
||||
assert_equal 'http://disney.com/logo.gif', var.name
|
||||
assert_equal [[:image,["'med'"]]], var.filters
|
||||
assert_equal [[:image,["'med'"]]], var.filters
|
||||
end
|
||||
|
||||
def test_string_single_quoted
|
||||
@@ -84,7 +84,7 @@ class VariableTest < Test::Unit::TestCase
|
||||
var = Variable.new(%| 'hello' |)
|
||||
assert_equal "'hello'", var.name
|
||||
end
|
||||
|
||||
|
||||
def test_integer
|
||||
var = Variable.new(%| 1000 |)
|
||||
assert_equal "1000", var.name
|
||||
@@ -94,7 +94,7 @@ class VariableTest < Test::Unit::TestCase
|
||||
var = Variable.new(%| 1000.01 |)
|
||||
assert_equal "1000.01", var.name
|
||||
end
|
||||
|
||||
|
||||
def test_string_with_special_chars
|
||||
var = Variable.new(%| 'hello! $!@.;"ddasd" ' |)
|
||||
assert_equal %|'hello! $!@.;"ddasd" '|, var.name
|
||||
@@ -109,14 +109,14 @@ end
|
||||
|
||||
class VariableResolutionTest < Test::Unit::TestCase
|
||||
include Liquid
|
||||
|
||||
def test_simple_variable
|
||||
|
||||
def test_simple_variable
|
||||
template = Template.parse(%|{{test}}|)
|
||||
assert_equal 'worked', template.render('test' => 'worked')
|
||||
assert_equal 'worked wonderfully', template.render('test' => 'worked wonderfully')
|
||||
end
|
||||
|
||||
def test_simple_with_whitespaces
|
||||
def test_simple_with_whitespaces
|
||||
template = Template.parse(%| {{ test }} |)
|
||||
assert_equal ' worked ', template.render('test' => 'worked')
|
||||
assert_equal ' worked wonderfully ', template.render('test' => 'worked wonderfully')
|
||||
|
||||
Reference in New Issue
Block a user