1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00
haml--haml/test/filters_test.rb
2012-05-21 19:10:51 -03:00

20 lines
No EOL
635 B
Ruby

# -*- coding: utf-8 -*-
require 'test_helper'
class FiltersTest < MiniTest::Unit::TestCase
def render(text, options = {}, &block)
scope = options.delete(:scope) || Object.new
locals = options.delete(:locals) || {}
Haml::Engine.new(text, options).to_html(scope, locals, &block)
end
test "modules including Haml::Filters::Base are registered as filters" do
begin
refute Haml::Filters.defined.has_key? "bar"
Module.new {def self.name; "Foo::Bar"; end; include Haml::Filters::Base}
assert Haml::Filters.defined.has_key? "bar"
ensure
Haml::Filters.defined.delete "bar"
end
end
end