Reverted james filter in tags branch

This reverts commit 282786d7e2.

Conflicts:

	lib/liquid.rb
	lib/liquid/variable.rb
	test/if_else_test.rb
This commit is contained in:
Tobias Lütke
2009-04-06 08:30:19 -06:00
parent e3fd003a74
commit edcc14f148
11 changed files with 20 additions and 56 deletions
-19
View File
@@ -112,25 +112,6 @@ class IfElseTest < Test::Unit::TestCase
assert_template_result('elsif','{% if false %}if{% elsif true %}elsif{% endif %}')
end
def test_with_filtered_expressions
assert_template_result('yes','{% if "BLAH"|downcase == "blah" %}yes{% endif %}')
assert_template_result('yes','{% if "FOO BAR"|truncatewords:1,"--" == "FOO--" %}yes{% endif %}')
assert_template_result('yes','{% if "FOO BAR"|truncatewords:1,"--"|downcase == "foo--" %}yes{% endif %}')
assert_template_result('yes','{% if "foo--" == "FOO BAR"|truncatewords:1,"--"|downcase %}yes{% endif %}')
# array transformation, to make sure we aren't converting arrays to strings somewhere along the way:
assert_template_result('yes','{% if values|sort == sorted %}yes{% endif %}', 'values' => %w{foo bar baz}, 'sorted' => %w{bar baz foo})
end
def test_allow_no_spaces_in_filtered_expressions
assert_template_result('','{% if "foo--" == "FOO BAR" |truncatewords:1,"--"|downcase %}yes{% endif %}')
assert_template_result('','{% if "foo--" == "FOO BAR"| truncatewords:1,"--"|downcase %}yes{% endif %}')
assert_template_result('','{% if "foo--" == "FOO BAR"|truncatewords :1,"--"|downcase %}yes{% endif %}')
assert_template_result('','{% if "foo--" == "FOO BAR"|truncatewords: 1,"--"|downcase %}yes{% endif %}')
assert_template_result('','{% if "foo--" == "FOO BAR"|truncatewords:1 ,"--"|downcase %}yes{% endif %}')
assert_template_result('','{% if "foo--" == "FOO BAR"|truncatewords:1, "--"|downcase %}yes{% endif %}')
assert_template_result('','{% if "foo--" == "FOO BAR"|truncatewords:1,"--" |downcase %}yes{% endif %}')
end
def test_syntax_error_no_variable
assert_raise(SyntaxError){ assert_template_result('', '{% if jerry == 1 %}')}
end