mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-18 10:20:43 -07:00
Seperate unit and integration tests.
This makes it easier to re-use the integration tests in a seperate gem that optimizes parts of liquid with a native implementation.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
require 'test_helper'
|
||||
|
||||
class ContextTest < Test::Unit::TestCase
|
||||
include Liquid
|
||||
|
||||
def test_override_global_filter
|
||||
global = Module.new do
|
||||
def notice(output)
|
||||
"Global #{output}"
|
||||
end
|
||||
end
|
||||
|
||||
local = Module.new do
|
||||
def notice(output)
|
||||
"Local #{output}"
|
||||
end
|
||||
end
|
||||
|
||||
Template.register_filter(global)
|
||||
assert_equal 'Global test', Template.parse("{{'test' | notice }}").render!
|
||||
assert_equal 'Local test', Template.parse("{{'test' | notice }}").render!({}, :filters => [local])
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user