Sha256: f7a6c3276760ad691abb8889b9d1ccc4733a8ef475a43fd6a5fb27afb1ce97ee

Contents?: true

Size: 768 Bytes

Versions: 3

Compression:

Stored size: 768 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 "compare" do
    i = Image['/app/images/email.png']
    j = Image['/app/images/email.png']

    assert j === i
  end

  test "dimensions" 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

3 entries across 3 versions & 2 rubygems

Version Path
sinatra-assetpack-0.1.7 test/img_test.rb
sundawg-sinatra-assetpack-fork-0.1.6 test/img_test.rb
sinatra-assetpack-0.1.6 test/img_test.rb