Sha256: 87d2a44fbd6b81c5d0c1687b7cfc64c5dcb0589eec34884afcfc5d1819f6c299

Contents?: true

Size: 1.11 KB

Versions: 27

Compression:

Stored size: 1.11 KB

Contents

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

class BuildTest < UnitTest
  teardown do
    FileUtils.rm_rf File.join(app.root, 'public')
  end

  test "build" do
    Stylus.expects(:compile).returns("body{background:#f00;color:#00f;}")
    app.assets.css_compression = :simple
    app.assets.build!

    assert File.file? File.join(app.root, 'public/js/app.js')
    assert File.mtime(File.join(app.root, 'public/js/app.js')).to_i == app.assets.packages['app.js'].mtime.to_i

    assert Dir[File.join(app.root, 'public/js/app.*.js')].first

    assert File.read(File.join(app.root, 'public/js/app.js')).include?('function(){alert("Hello");')

    assert Dir["#{app.root}/public/images/background.*.jpg"].first
    assert Dir["#{app.root}/public/images/email.*.png"].first

    assert \
      File.mtime(Dir["#{app.root}/public/images/background.*.jpg"].first).to_i ==
      File.mtime(Dir["#{app.root}/public/images/background.jpg"].first).to_i

    assert \
      File.mtime(Dir["#{app.root}/public/images/background.*.jpg"].first).to_i ==
      File.mtime(Dir["#{app.root}/app/images/background.jpg"].first).to_i
  end
end

Version data entries

27 entries across 27 versions & 3 rubygems

Version Path
sinatra-assetpack-0.3.5 test/build_test.rb
sinatra-assetpack-0.3.3 test/build_test.rb
sinatra-assetpack-0.3.2 test/build_test.rb
sinatra-assetpack-0.3.1 test/build_test.rb
sinatra-assetpack-0.3.0 test/build_test.rb
sinatra-assetpack-0.2.8 test/build_test.rb
sinatra-assetpack-0.2.7 test/build_test.rb
sinatra-assetpack-0.2.6 test/build_test.rb
sinatra-assetpack-0.2.5 test/build_test.rb
sinatra-assetpack-0.2.4 test/build_test.rb
sinatra-assetpack-0.2.3 test/build_test.rb
sinatra-assetpack-0.2.2 test/build_test.rb
sinatra-assetpack-0.2.1 test/build_test.rb
sinatra-assetpack-0.2.0 test/build_test.rb
sinatra-assetpack-0.1.7 test/build_test.rb
sundawg-sinatra-assetpack-fork-0.1.6 test/build_test.rb
sinatra-assetpack-0.1.6 test/build_test.rb
sinatra-assetpack-0.1.5 test/build_test.rb
sinatra-assetpack-0.1.4 test/build_test.rb
sinatra-assetpack-0.1.3 test/build_test.rb