Sha256: a626a155d9fdc6a418d3a35d9da6cd248c18c47d1d066b06d772563698327f25

Contents?: true

Size: 775 Bytes

Versions: 47

Compression:

Stored size: 775 Bytes

Contents

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

class CssAppTest < Test::Unit::TestCase
  include Rack::Test::Methods

  class App < Sinatra::Base
    register Sinatra::CssSupport
    serve_css '/css', :from => File.expand_path('../fixtures/css', __FILE__)
  end

  def app
    App.new
  end

  def assert_css(css)
    left  = last_response.body.gsub(/[ \r\n\t]+/m, '')
    right = css.gsub(/[ \r\n\t]+/m, '')

    assert_equal left, right

  end
  test "sass" do
    get '/css/style-sass.css'

    assert_css "body, #sass {\n  color: #333333; }\n"
  end

  test "scss" do
    get '/css/style-scss.css'

    assert_css "body, #scss {\n  color: #333333; }\n"
  end

  test "less" do
    get '/css/style-less.css'

    assert_css "body, #less { color: #333333; }\n"
  end
end

Version data entries

47 entries across 47 versions & 2 rubygems

Version Path
classiccms-0.3.4 vendor/bundle/gems/sinatra-support-1.2.2/test/test_css.rb
classiccms-0.3.3 vendor/bundle/gems/sinatra-support-1.2.2/test/test_css.rb
classiccms-0.3.2 vendor/bundle/gems/sinatra-support-1.2.2/test/test_css.rb
classiccms-0.3.1 vendor/bundle/gems/sinatra-support-1.2.2/test/test_css.rb
classiccms-0.3.0 vendor/bundle/gems/sinatra-support-1.2.2/test/test_css.rb
classiccms-0.2.4.pre vendor/bundle/gems/sinatra-support-1.2.2/test/test_css.rb
sinatra-support-1.2.2 test/test_css.rb