Sha256: 78641e16be371b71fc6bfba58e5713908a7fa1c119047b852e5ebf091cb8982e

Contents?: true

Size: 787 Bytes

Versions: 11

Compression:

Stored size: 787 Bytes

Contents

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

class TemplateCacheTest < UnitTest
  class App < Main
    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

11 entries across 11 versions & 1 rubygems

Version Path
sinatra-assetpack-0.3.5 test/template_cache_test.rb
sinatra-assetpack-0.3.3 test/template_cache_test.rb
sinatra-assetpack-0.3.2 test/template_cache_test.rb
sinatra-assetpack-0.3.1 test/template_cache_test.rb
sinatra-assetpack-0.3.0 test/template_cache_test.rb
sinatra-assetpack-0.2.8 test/template_cache_test.rb
sinatra-assetpack-0.2.7 test/template_cache_test.rb
sinatra-assetpack-0.2.6 test/template_cache_test.rb
sinatra-assetpack-0.2.5 test/template_cache_test.rb
sinatra-assetpack-0.2.4 test/template_cache_test.rb
sinatra-assetpack-0.2.3 test/template_cache_test.rb