Created
November 13, 2009 21:30
-
-
Save chriseppstein/234185 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.dirname(__FILE__) + '/../test_helper' | |
require 'compass/test_case' | |
class StylesheetsTest < Compass::TestCase | |
class << self | |
def sass_files(path) | |
Dir.glob(File.join(path, "**", "[^_]*.sass")) | |
end | |
def test_stylesheet(sass_file, &block) | |
define_method("test_#{File.basename(sass_file)[0..-6]}") do | |
check_stylesheet(sass_file) | |
block.call(sass_file) if block | |
end | |
end | |
end | |
sass_files("#{RAILS_ROOT}/app/stylesheets").each {|f| test_stylesheet(f)} | |
protected | |
def check_stylesheet(sass_file) | |
assert_compiles(sass_file) do |result| | |
assert_not_blank result | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment