Guest User

Untitled

a guest
Apr 24th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. require File.dirname(__FILE__) + '/../test_helper'
  2. require 'compass/test_case'
  3.  
  4. class StylesheetsTest < Compass::TestCase
  5.  
  6. class << self
  7. def sass_files(path)
  8. Dir.glob(File.join(path, "**", "[^_]*.sass"))
  9. end
  10. def test_stylesheet(sass_file, &block)
  11. define_method("test_#{File.basename(sass_file)[0..-6]}") do
  12. check_stylesheet(sass_file)
  13. block.call(sass_file) if block
  14. end
  15. end
  16. end
  17.  
  18. sass_files("#{RAILS_ROOT}/app/stylesheets").each {|f| test_stylesheet(f)}
  19.  
  20. protected
  21. def check_stylesheet(sass_file)
  22. assert_compiles(sass_file) do |result|
  23. assert_not_blank result
  24. end
  25. end
  26.  
  27. end
Add Comment
Please, Sign In to add comment