1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00
haml--haml/test/sass/engine_test.rb
nex3 76c6207178 Tests fully functional, if not pretty.
git-svn-id: svn://hamptoncatlin.com/haml/branches/1.5dev@189 7063305b-7217-0410-af8c-cdc13e5119b9
2006-12-03 23:17:45 +00:00

28 lines
737 B
Ruby

#!/usr/bin/env ruby
require 'test/unit'
require File.dirname(__FILE__) + '/../../lib/sass/engine'
class SassEngineTest < Test::Unit::TestCase
def setup
@engine = Sass::Engine.new
end
def test_basic_render
renders_correctly "basic"
end
def renders_correctly(name)
sass_file = load_file(name, "sass")
css_file = load_file(name, "css")
css_result = @engine.render(sass_file)
#puts css_result.collect { |a| a.inspect }.join("\n ")
assert_equal css_file.strip, css_result.strip
end
def load_file(name, type = "sass")
@result = ''
File.new(File.dirname(__FILE__) + "/#{type == 'sass' ? 'templates' : 'results'}/#{name}.#{type}").each_line { |l| @result += l }
@result
end
end