add test for inline_font_files()

This commit is contained in:
Micah Geisel 2011-09-07 13:06:01 -07:00
parent bced277049
commit d644e54a38
3 changed files with 7 additions and 0 deletions

1
test/fixtures/fonts/bgrove.base64.txt vendored Normal file

File diff suppressed because one or more lines are too long

BIN
test/fixtures/fonts/bgrove.ttf vendored Executable file

Binary file not shown.

View File

@ -112,6 +112,12 @@ class SassExtensionsTest < Test::Unit::TestCase
}
end
def test_inline_font_files
Compass.configuration.fonts_path = File.expand_path "../fixtures/fonts", File.dirname(__FILE__)
base64_string = File.read(File.join(Compass.configuration.fonts_path, "bgrove.base64.txt")).chomp
assert_equal "url('data:font/truetype;base64,#{base64_string}') format('truetype')", evaluate("inline_font_files('bgrove.ttf', truetype)")
end
protected
def evaluate(value)
Sass::Script::Parser.parse(value, 0, 0).perform(Sass::Environment.new).to_s