Sha256: 1b9bd6df8c8100eb61b2f46dbda6130b55434ab38dc904dab3849a686640f5fc

Contents?: true

Size: 1.48 KB

Versions: 5

Compression:

Stored size: 1.48 KB

Contents

require File.expand_path("../helper", __FILE__)

class TestStylesheet < Test::Unit::TestCase
  context "A Site" do
    setup { site() }
  
    should "render CSS stylesheets" do
      stylesheet = Massimo::Stylesheet.new(source_dir("stylesheets", "basic.css"))
      assert_equal "body {\n  font-size: 12px;\n}", stylesheet.render
    end
  
    should "render Sass stylesheets" do
      stylesheet = Massimo::Stylesheet.new(source_dir("stylesheets", "application.sass"))
      assert_equal "body {\n  font-size: 12px; }\n\n#header {\n  font-size: 36px; }\n", stylesheet.render
    end
  
    should "render Less stylesheets" do
      stylesheet = Massimo::Stylesheet.new(source_dir("stylesheets", "less_file.less"))
      assert_equal "#header { color: #4d926f; }\n", stylesheet.render
    end
  
    context "processing Stylesheets" do
      should "output the css file to the stylesheets dir" do
        Massimo::Stylesheet.new(source_dir("stylesheets", "application.sass")).process!
        assert_equal "body {\n  font-size: 12px; }\n\n#header {\n  font-size: 36px; }\n", File.read(output_dir("stylesheets", "application.css"))
      end
    
      teardown { clear_output }
    end
  end
  
  context "A Production Site" do
    setup { site(:production => true)}
    
    should "should compress Sass stylesheets" do
      stylesheet = Massimo::Stylesheet.new(source_dir("stylesheets", "application.sass"))
      assert_equal "body{font-size:12px}#header{font-size:36px}\n", stylesheet.render
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
massimo-0.4.6 test/test_stylesheet.rb
massimo-0.4.5 test/test_stylesheet.rb
massimo-0.4.4 test/test_stylesheet.rb
massimo-0.4.3 test/test_stylesheet.rb
massimo-0.4.2 test/test_stylesheet.rb