Sha256: 32827fde574012bbfcbad118b3faac2892814518d49cd2018f96f55550e3f48e

Contents?: true

Size: 1.2 KB

Versions: 65

Compression:

Stored size: 1.2 KB

Contents

require "lib/builders/spec_helper"

# If less is not installed, just skip these.
has_less = true
begin
  require 'less'

rescue Exception => e
  puts "WARNING: Skipping SC::Builder::Less tests because less is not installed.  Run 'sudo gem install less' first and try again."
  has_less = false
end

if has_less
  describe SC::Builder::Less do

    include SC::SpecHelpers
    include SC::BuilderSpecHelper

    before do
      std_before :less_test
      @manifest.add_entry 'icons/image.png'
    end


    after do
      std_after
    end

    def run_builder(filename)
      super do |entry, dst_path|
        SC::Builder::Less.build(entry, dst_path)
      end
    end

    it "should build a less file" do
      lines = run_builder('sample.less')
      lines = lines.join('').gsub("\n",'') # strip newlines to make compare easy

      # just verify that output looks like the CSS we expect
      lines.should =~ /\#main\s+p.+\{.+color.+width.+\}/
    end

    it "converts static_url() and sc_static() => 'url('foo')' " do
      lines = run_builder('sample.less')
      css = lines.join("\n")

      css.should_not =~ /(static_url|sc_static)/
      css.should =~ /url\('.+'\)/ # important MUST have some url...
    end
  end
end

Version data entries

65 entries across 65 versions & 1 rubygems

Version Path
sproutcore-1.11.0 spec/lib/builders/less_spec.rb
sproutcore-1.11.0.rc3 spec/lib/builders/less_spec.rb
sproutcore-1.11.0.rc2 spec/lib/builders/less_spec.rb
sproutcore-1.11.0.rc1 spec/lib/builders/less_spec.rb
sproutcore-1.10.3.1 spec/lib/builders/less_spec.rb
sproutcore-1.10.2 spec/lib/builders/less_spec.rb
sproutcore-1.10.1 spec/lib/builders/less_spec.rb
sproutcore-1.10.0 spec/lib/builders/less_spec.rb
sproutcore-1.10.0.rc.3 spec/lib/builders/less_spec.rb
sproutcore-1.10.0.rc.2 spec/lib/builders/less_spec.rb
sproutcore-1.10.0.rc.1 spec/lib/builders/less_spec.rb
sproutcore-1.9.2 spec/lib/builders/less_spec.rb
sproutcore-1.9.1 spec/lib/builders/less_spec.rb
sproutcore-1.9.0 spec/lib/builders/less_spec.rb
sproutcore-1.8.2.1 spec/lib/builders/less_spec.rb
sproutcore-1.8.1 spec/lib/builders/less_spec.rb
sproutcore-1.8.0 spec/lib/builders/less_spec.rb
sproutcore-1.7.1.beta-java spec/lib/builders/less_spec.rb
sproutcore-1.7.1.beta spec/lib/builders/less_spec.rb
sproutcore-1.6.0.1-java spec/lib/builders/less_spec.rb