Sha256: 232362b1f5d1cd585450d3532ddbbfdd60cefa1bbf3870a484af1f065903b04d

Contents?: true

Size: 1.26 KB

Versions: 4

Compression:

Stored size: 1.26 KB

Contents

require File.dirname(__FILE__) + '/spec_helper'

module LessEngineSpecHelper
  def lessify(string)
    return Less::Engine.new(string).to_css(:desc)
  end
end

describe Less::Engine do
  include LessEngineSpecHelper

  describe "to_css" do
    it "should return an empty string for p {}" do
      lessify('p {}').should == ''
    end

    it "should return css with variable usage" do
      lessify("@brand_color: #4D926F;\n #header { color: @brand_color; }").should == "#header { color: #4D926F; }"
    end

    it "should return css as shown on home page" do
      lessify("#header { \n  color: red;\n  a {\n    font-weight: bold;\n    text-decoration: none;\n  }\n}").should == "#header { color: red; }\n#header a { font-weight: bold; text-decoration: none; }"
    end

    it "should handle :hover" do
      lessify("a:hover {\n color: red; }").should == "a:hover { color: red; }"
    end

    it "should handle instances of double-quotes" do
      lessify("blockquote:before, blockquote:after, q:before, q:after {\n content: \"\"; }").should == "blockquote:before, blockquote:after, q:before, q:after { content: ''; }"
    end
    
    it "should parse tag attributes" do
      lessify("input[type=text] { color: red; }").should == "input[type=text] { color: red; }"
    end
  end
end


Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
cloudhead-less-0.8.12 spec/engine_spec.rb
xdissent-less-0.8.12 spec/engine_spec.rb
less-0.8.12 spec/engine_spec.rb
less-0.8.13 spec/engine_spec.rb