Sha256: ff3f45e072617fc96ceafd514c422b0d9d0e48fc03c937873508663fa89b4fbd

Contents?: true

Size: 826 Bytes

Versions: 18

Compression:

Stored size: 826 Bytes

Contents

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

class TemplateCacheTest < UnitTest
  class App < UnitTest::App
    register Sinatra::AssetPack

    set :reload_templates, false
    assets do |a|
      a.css :a, '/a.css', %w[/css/screen.css]
    end
  end

  def app() App; end

  test "cache dynamic files when reload templates is false" do
    App.any_instance.expects(:asset_filter_css).times(1).returns "OK"
    10.times { get '/css/screen.css' }
  end

  test "cache static css files when reload templates is false" do
    App.any_instance.expects(:asset_filter_css).times(1).returns "OK"
    10.times { get '/css/style.css' }
  end

  test "cache packages when reload templates is false" do
    Sinatra::AssetPack::Package.any_instance.expects(:minify).times(1).returns "OK"
    10.times { get '/a.css' }
  end
end

Version data entries

18 entries across 18 versions & 3 rubygems

Version Path
sinatra-assetpack-0.2.2 test/template_cache_test.rb
sinatra-assetpack-0.2.1 test/template_cache_test.rb
sinatra-assetpack-0.2.0 test/template_cache_test.rb
sinatra-assetpack-0.1.7 test/template_cache_test.rb
sundawg-sinatra-assetpack-fork-0.1.6 test/template_cache_test.rb
sinatra-assetpack-0.1.6 test/template_cache_test.rb
sinatra-assetpack-0.1.5 test/template_cache_test.rb
sinatra-assetpack-0.1.4 test/template_cache_test.rb
sinatra-assetpack-0.1.3 test/template_cache_test.rb
sinatra-assetpack-0.1.2 test/template_cache_test.rb
sinatra-assetpack-0.1.1 test/template_cache_test.rb
sinatra-assetpack-0.1.0 test/template_cache_test.rb
sinatra-assetpack-flexible-compression-0.0.1 test/template_cache_test.rb
sundawg-sinatra-assetpack-fork-0.0.12.pre1 test/template_cache_test.rb
sinatra-assetpack-0.0.12.pre1 test/template_cache_test.rb
sinatra-assetpack-0.0.11 test/template_cache_test.rb
sinatra-assetpack-0.0.10 test/template_cache_test.rb
sinatra-assetpack-0.0.9 test/template_cache_test.rb