Sha256: f43356c9f274d886f47d6b982524874efc192ef2f90fcb4ada01e84607b695f0

Contents?: true

Size: 1.47 KB

Versions: 3

Compression:

Stored size: 1.47 KB

Contents

require "test/helper"
require "test/app_helper"
require 'test/fixtures/sinatra/app'

class SinatraTest < Test::Unit::TestCase

  def app
    @app ||= SinatraApp
  end
  def default_value(name)
    Rack::Less::Base.defaults["#{Rack::Less::Options::RACK_ENV_NS}.#{name}"]
  end

  context "A Sinatra app using Rack::Less" do

    context "requesting valid LESS" do
      setup do
        app.use Rack::Less,
          :root => file_path('test','fixtures','sinatra')

        @compiled = File.read(file_path('test','fixtures','sinatra','app','stylesheets', 'normal_compiled.css'))
        @response = visit "/stylesheets/normal.css"
      end

      should_respond_with_compiled_css
    end

    context "requesting a nested valid LESS" do
      setup do
        app.use Rack::Less,
          :root => file_path('test','fixtures','sinatra')

        @compiled = File.read(file_path('test','fixtures','sinatra','app','stylesheets', 'nested', 'file_compiled.css'))
        @response = visit "/stylesheets/nested/file.css"
      end

      should_respond_with_compiled_css
    end

    context "requesting a really nested valid LESS" do
      setup do
        app.use Rack::Less,
          :root => file_path('test','fixtures','sinatra')

        @compiled = File.read(file_path('test','fixtures','sinatra','app','stylesheets', 'nested', 'really', 'really_compiled.css'))
        @response = visit "/stylesheets/nested/really/really.css"
      end

      should_respond_with_compiled_css
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rack-less-2.0.2 test/sinatra_test.rb
rack-less-2.0.1 test/sinatra_test.rb
rack-less-2.0.0 test/sinatra_test.rb