Sha256: 1c7ab5e83a4dacb8c70eb9321f948c9c4978bb964487446e8e911c3bffd0f7f2

Contents?: true

Size: 765 Bytes

Versions: 13

Compression:

Stored size: 765 Bytes

Contents

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

class ImgTest < UnitTest
  Image = Sinatra::AssetPack::Image

  test "get img" do
    get '/images/email.png'
    assert_equal last_response.headers['Content-Length'], File.size(r("/app/images/email.png")).to_s
  end

  test "get img with cache buster" do
    get '/images/email.893748.png'
    assert_equal last_response.headers['Content-Length'], File.size(r("/app/images/email.png")).to_s
  end

  test "Image[]" do
    i = Image['/app/images/email.png']
    j = Image['/app/images/email.png']

    assert j === i
  end

  test "Image[]" do
    i = Image['/app/images/email.png']
    j = Image['/app/images/email.png']

    Image.any_instance.expects(:`).times(1)
    j.dimensions
    i.dimensions
  end
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
sinatra-assetpack-0.1.5 test/img_test.rb
sinatra-assetpack-0.1.4 test/img_test.rb
sinatra-assetpack-0.1.3 test/img_test.rb
sinatra-assetpack-0.1.2 test/img_test.rb
sinatra-assetpack-0.1.1 test/img_test.rb
sinatra-assetpack-0.1.0 test/img_test.rb
sinatra-assetpack-flexible-compression-0.0.1 test/img_test.rb
sundawg-sinatra-assetpack-fork-0.0.12.pre1 test/img_test.rb
sinatra-assetpack-0.0.12.pre1 test/img_test.rb
sinatra-assetpack-0.0.11 test/img_test.rb
sinatra-assetpack-0.0.10 test/img_test.rb
sinatra-assetpack-0.0.9 test/img_test.rb
sinatra-assetpack-0.0.8 test/img_test.rb