Sha256: 166176d45c659c3cb0094a2b2ee3c1eed92238ec8000970e4265eaeca6aec614

Contents?: true

Size: 704 Bytes

Versions: 11

Compression:

Stored size: 704 Bytes

Contents

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

class CacheTest < UnitTest
  class App < Main
    set :reload_templates, false
    assets {
      js :app, '/js/app.js', [
        '/js/vendor/**/*.js',
        '/js/assets/**/*.js',
        '/js/hi.js',
        '/js/hell*.js'
      ]
      js_compression :jsmin
    }
  end

  def app
    App
  end

  test "Compressed js caching" do
    app.set :reload_templates, false
    app.stubs(:clear_tilt_cache).returns(false)  # return false each time it calls after the first time.
    app.expects(:clear_tilt_cache).returns(true).times(1) # clear cache one time.

    JSMin.expects(:minify).times(1).returns ""
    3.times { get '/js/app.js' }
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

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