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.5.13 vendor/bundle/gems/sinatra-support-1.2.2/test/test_css.rb
classiccms-0.5.12 vendor/bundle/gems/sinatra-support-1.2.2/test/test_css.rb
classiccms-0.5.11 vendor/bundle/gems/sinatra-support-1.2.2/test/test_css.rb
classiccms-0.5.10 vendor/bundle/gems/sinatra-support-1.2.2/test/test_css.rb
classiccms-0.5.9 vendor/bundle/gems/sinatra-support-1.2.2/test/test_css.rb
classiccms-0.5.8 vendor/bundle/gems/sinatra-support-1.2.2/test/test_css.rb
classiccms-0.5.7 vendor/bundle/gems/sinatra-support-1.2.2/test/test_css.rb
classiccms-0.5.6 vendor/bundle/gems/sinatra-support-1.2.2/test/test_css.rb
classiccms-0.5.5 vendor/bundle/gems/sinatra-support-1.2.2/test/test_css.rb
classiccms-0.5.2 vendor/bundle/gems/sinatra-support-1.2.2/test/test_css.rb
classiccms-0.5.1 vendor/bundle/gems/sinatra-support-1.2.2/test/test_css.rb
classiccms-0.5.0 vendor/bundle/gems/sinatra-support-1.2.2/test/test_css.rb
classiccms-0.4.2 vendor/bundle/gems/sinatra-support-1.2.2/test/test_css.rb
classiccms-0.4.1 vendor/bundle/gems/sinatra-support-1.2.2/test/test_css.rb
classiccms-0.4.0 vendor/bundle/gems/sinatra-support-1.2.2/test/test_css.rb
classiccms-0.3.9 vendor/bundle/gems/sinatra-support-1.2.2/test/test_css.rb
classiccms-0.3.8 vendor/bundle/gems/sinatra-support-1.2.2/test/test_css.rb
classiccms-0.3.7 vendor/bundle/gems/sinatra-support-1.2.2/test/test_css.rb
classiccms-0.3.6 vendor/bundle/gems/sinatra-support-1.2.2/test/test_css.rb
classiccms-0.3.5 vendor/bundle/gems/sinatra-support-1.2.2/test/test_css.rb