Added test coverage for font_files (issue #543)

This commit is contained in:
Raving Genius 2011-09-08 20:59:03 -04:00
parent 0667ccf89c
commit 8a2da92c91

View File

@ -98,6 +98,14 @@ class SassExtensionsTest < Test::Unit::TestCase
assert_equal "true", evaluate("prefixed(-css2, css2-fallback(css3, css2))") assert_equal "true", evaluate("prefixed(-css2, css2-fallback(css3, css2))")
end end
def test_font_files
assert_equal '', evaluate('font_files()')
assert_equal "url(/font/name.woff) format('woff'), url(/fonts/name.ttf) format('truetype'), url(/fonts/name.svg#fontpath) format('svg')", evaluate("font-files('/font/name.woff', woff, '/fonts/name.ttf', truetype, '/fonts/name.svg#fontpath', svg)")
assert_raises Sass::SyntaxError do
evaluate("font-files('/font/name.woff')")
end
end
%w(stylesheet_url font_url image_url generated_image_url).each do |helper| %w(stylesheet_url font_url image_url generated_image_url).each do |helper|
class_eval %Q{ class_eval %Q{
def test_#{helper}_helper_defers_to_existing_helper def test_#{helper}_helper_defers_to_existing_helper