Sha256: 41827448dd01e97abd1a5ba659cfdc4af42d649d57b8d854255cd29056c627cb

Contents?: true

Size: 875 Bytes

Versions: 15

Compression:

Stored size: 875 Bytes

Contents

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

class NonExistentTest < UnitTest
  class App < UnitTest::App
    register Sinatra::AssetPack

    assets do |a|
      a.js :script, '/script.min.js', [
        '/js/h*.js',
        '/js/combine.js'
      ]

      a.js_compression :closure
      a.css_compression = :yui
    end

    get '/js/combine.js' do
      "alert('Spin spin sugar');"
    end

    get '/' do
      js :script
    end
  end

  def app
    App
  end

  test "non-existent files in js helper" do
    get '/'
    assert body.include?('combine.js')
  end

  test "dev non-existent files in js helper" do
    App.expects(:environment).returns(:development).times(1..100)
    get '/'
    assert body.include?('combine.js')
  end

  test "non-existent files in js minifier" do
    get '/script.min.js'
    assert body.include?('Spin spin sugar')
  end
end

Version data entries

15 entries across 15 versions & 3 rubygems

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